From patchwork Thu Mar 30 16:57:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3198 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp1648845vss; Thu, 30 Mar 2017 09:58:00 -0700 (PDT) X-Received: by 10.28.225.69 with SMTP id y66mr4643731wmg.84.1490893080356; Thu, 30 Mar 2017 09:58:00 -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 y92si4277967wrb.0.2017.03.30.09.57.59; Thu, 30 Mar 2017 09:58:00 -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 81531689999; Thu, 30 Mar 2017 19:57:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 04D056883D9 for ; Thu, 30 Mar 2017 19:57:51 +0300 (EEST) Received: from [172.31.218.31] (helo=vie01a-dmta-pe01-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ctdOQ-0004fr-N6 for ffmpeg-devel@ffmpeg.org; Thu, 30 Mar 2017 18:57:50 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ctdOL-0007yE-20 for ffmpeg-devel@ffmpeg.org; Thu, 30 Mar 2017 18:57:45 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 2Gxg1v01H0S5wYM01GxhD0; Thu, 30 Mar 2017 18:57:42 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 30 Mar 2017 18:57:40 +0200 Message-Id: <20170330165740.30561-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg: Fix dereference before NULL check 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 CID1401675 Signed-off-by: Michael Niedermayer --- ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 11faf0d4a8..b11a6a1409 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1848,14 +1848,14 @@ static void flush_encoders(void) // Try to enable encoding with no input frames. // Maybe we should just let encoding fail instead. if (!ost->initialized) { - FilterGraph *fg = ost->filter->graph; char error[1024] = ""; av_log(NULL, AV_LOG_WARNING, "Finishing stream %d:%d without any data written to it.\n", ost->file_index, ost->st->index); - if (ost->filter && !fg->graph) { + if (ost->filter && !ost->filter->graph->graph) { + FilterGraph *fg = ost->filter->graph; int x; for (x = 0; x < fg->nb_inputs; x++) { InputFilter *ifilter = fg->inputs[x];