]> git.sesse.net Git - ffmpeg/commitdiff
h264: check that DPB is allocated before accessing it in flush_dpb()
authorAnton Khirnov <anton@khirnov.net>
Sun, 10 Mar 2013 22:28:31 +0000 (23:28 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 11 Mar 2013 17:30:31 +0000 (18:30 +0100)
libavcodec/h264.c

index de5ca403ae489a0a13f4dc19c757f14d22b73115..e0d5433a4e63d2f3c95b27907fdeb6f9cdd5d343 100644 (file)
@@ -2623,8 +2623,9 @@ static void flush_dpb(AVCodecContext *avctx)
 
     flush_change(h);
 
-    for (i = 0; i < MAX_PICTURE_COUNT; i++)
-        unref_picture(h, &h->DPB[i]);
+    if (h->DPB)
+        for (i = 0; i < MAX_PICTURE_COUNT; i++)
+            unref_picture(h, &h->DPB[i]);
     h->cur_pic_ptr = NULL;
     unref_picture(h, &h->cur_pic);