Commit 9fe73b01 authored by tiejun.peng@foxmail.com's avatar tiejun.peng@foxmail.com Committed by Michael Niedermayer

avformat/ftp: Solve a crash bug when network occur a exception

This fixes a proble where ffmpeg would cause crash to do a seek when the network disconnect.
The log like this:
01-01 10:53:03.441  6580  6580 F DEBUG   : backtrace:
01-01 10:53:03.441  6580  6580 F DEBUG   :     #00 pc 0002942e  /system/lib/libavformat.so (ffurl_write+9)
Signed-off-by: 's avatartiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b02027c7
...@@ -206,6 +206,9 @@ static int ftp_send_command(FTPContext *s, const char *command, ...@@ -206,6 +206,9 @@ static int ftp_send_command(FTPContext *s, const char *command,
if (response) if (response)
*response = NULL; *response = NULL;
if (!s->conn_control)
return AVERROR(EIO);
if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0) if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
return err; return err;
if (!err) if (!err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment