diff mbox

[FFmpeg-devel] ffmpeg: Fix dereference before NULL check

Message ID 20170330165740.30561-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer March 30, 2017, 4:57 p.m. UTC
Fixes CID1401675

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

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];