avfilter/af_join: Fix crash in join filter
authorNikolas Bowe <nbowe-at-google.com@ffmpeg.org>
Fri, 2 Feb 2018 23:11:04 +0000 (15:11 -0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 3 Feb 2018 20:37:19 +0000 (21:37 +0100)
Previously if ff_outlink_frame_wanted() returned 0 it could dereference a null pointer when trying to read nb_samples.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/af_join.c

index cf5131e..4f86e13 100644 (file)
@@ -485,6 +485,9 @@ static int activate(AVFilterContext *ctx)
                 return 0;
             }
         }
+        if (!s->input_frames[0]) {
+            return 0;
+        }
     }
 
     nb_samples = s->input_frames[0]->nb_samples;