avcodec/mpegvideo: Check for NULL in ff_mpv_common_end()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 13 Jul 2015 17:18:08 +0000 (19:18 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 13 Jul 2015 17:26:37 +0000 (19:26 +0200)
Fixes: af94b3a3d26586c08f557cafe8246251_signal_sigsegv_7ffff713351a_343_XFMode.ASF with 1048576 alloc limit

Found-by: Samuel GroƟ, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpegvideo.c

index 637b569..870d790 100644 (file)
@@ -1107,6 +1107,9 @@ void ff_mpv_common_end(MpegEncContext *s)
 {
     int i;
 
+    if (!s)
+        return ;
+
     if (s->slice_context_count > 1) {
         for (i = 0; i < s->slice_context_count; i++) {
             free_duplicate_context(s->thread_context[i]);