From patchwork Thu Sep 15 22:37:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 598 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp146280vsd; Thu, 15 Sep 2016 15:41:05 -0700 (PDT) X-Received: by 10.194.162.162 with SMTP id yb2mr10079168wjb.38.1473979265676; Thu, 15 Sep 2016 15:41:05 -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 n184si4435168wme.83.2016.09.15.15.41.05; Thu, 15 Sep 2016 15:41:05 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21AE8689EF4; Fri, 16 Sep 2016 01:40:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0726D689E63 for ; Fri, 16 Sep 2016 01:40:40 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bkfKu-0003kf-Vi for ffmpeg-devel@ffmpeg.org; Fri, 16 Sep 2016 00:40:52 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id jygr1t0070S5wYM01ygs1l; Fri, 16 Sep 2016 00:40:52 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 16 Sep 2016 00:37:03 +0200 Message-Id: <20160915223703.19392-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160915223703.19392-1-michael@niedermayer.cc> References: <20160915223703.19392-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avformat/movenc: Check packet in mov_write_single_packet() too 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes assertion failure Found-by: durandal117 Signed-off-by: Michael Niedermayer --- libavformat/movenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 2d8fc48..b704f49 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4971,6 +4971,10 @@ static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) int64_t frag_duration = 0; int size = pkt->size; + int ret = check_pkt(s, pkt); + if (ret < 0) + return ret; + if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) { int i; for (i = 0; i < s->nb_streams; i++)