diff --git a/libavformat/ftp.c b/libavformat/ftp.c index 0663b47bc4..9aa7a45629 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -206,6 +206,9 @@ static int ftp_send_command(FTPContext *s, const char *command, if (response) *response = NULL; + if (!s->conn_control) + return AVERROR(EIO); + if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0) return err; if (!err)