From patchwork Tue Apr 4 14:12:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tiejun.peng" X-Patchwork-Id: 3286 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp207776vss; Tue, 4 Apr 2017 07:12:48 -0700 (PDT) X-Received: by 10.28.60.65 with SMTP id j62mr14599052wma.73.1491315168591; Tue, 04 Apr 2017 07:12:48 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y81si19986711wme.30.2017.04.04.07.12.48; Tue, 04 Apr 2017 07:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A03A6882A3; Tue, 4 Apr 2017 17:12:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA4206808CA for ; Tue, 4 Apr 2017 17:12:35 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1491315141; bh=jGM6OgqijCuTG/C0BlEXhTd0m9kEaZIpZpX+SGFc1jA=; h=From:To:Cc:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:Date:Message-ID; b=P76A/Ee767EENfoCcXXIbBFUm8SDn7eMRl8GEKTtK8HyxppUZfR3YPHaAIk/iBsaX f6ATgWsgrrit5yIMSG3eirPAfeaGivYKt/1Uoj697Is4dZ4m5rMZekfaEnjYh8QftZ Qr4nXIvKU+x6Rjfa8mCEvniKb8qExJ5bS6YQo8u4= X-QQ-FEAT: zAuE70+xlvnbgtlaos7PnFh7pgayaITpakuzwkyptJAG5LxGBnP82k0fSn9z5 39SjW5fiLDs40OzpL84hX+Ny6I3dupiCyQZ3Ee/y0sk9QPGNwSeEN3fGkXYfTFa54qTUblo eaGaILTBR+p8CV/s43B49Hqrd/69zD7a9RqyeCFRxVJhNXvLjSRyNynAf2pCKJVTPC8QEpX gmz7JHXVOS1Mibs8ZSxBwhZrEGe7zesZNaVK10xbcX8a20LbcTke0PL/OqSidkPyZCpVXDk NzDWaxrvOx9Yfq X-QQ-SSF: 000000000000000000000000000000U X-HAS-ATTACH: no X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 223.73.102.161 X-QQ-STYLE: X-QQ-mid: webmail835t1491315139t786471 From: "=?ISO-8859-1?B?RjE=?=" To: "=?ISO-8859-1?B?ZmZtcGVnLWRldmVs?=" Mime-Version: 1.0 Date: Tue, 4 Apr 2017 22:12:19 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-QQ-SENDSIZE: 520 Feedback-ID: webmail:foxmail.com:bgforeign:bgforeign1 X-QQ-Bgrelay: 1 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH v2] avformat/ftp: Solve a crash bug when network occur a exception X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: =?ISO-8859-1?B?RjE=?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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: tiejun.peng --- libavformat/ftp.c | 3 +++ 1 file changed, 3 insertions(+) -- Please have a look this patch, give some advice or merge it. Thank you . 2.7.4 diff --git a/libavformat/ftp.c b/libavformat/ftp.c index 0663b47..9aa7a45 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)