mpegvideo: synchronize AVFrame pointers in ERContext fully
authorJanne Grunau <janne-libav@jannau.net>
Wed, 11 Jun 2014 17:40:28 +0000 (19:40 +0200)
committerJanne Grunau <janne-libav@jannau.net>
Wed, 11 Jun 2014 19:28:27 +0000 (21:28 +0200)
Since error resilience uses AVFrame pointers instead of references it
has to copy NULL pointers too. After a codec flush the last/next frame
pointers in MpegEncContext are NULL and the old pointers remaining in
ERContext are invalid. Fixes a crash in vlc for android thumbnailer.
Reported and debugged by Adrien Maglo <magsoft@videolan.org>.

libavcodec/mpegvideo.c

index 49bc70c..aea6321 100644 (file)
@@ -2470,8 +2470,11 @@ void ff_mpeg_set_erpic(ERPicture *dst, Picture *src)
 {
     int i;
 
-    if (!src)
+    if (!src) {
+        dst->f  = NULL;
+        dst->tf = NULL;
         return;
+    }
 
     dst->f = src->f;
     dst->tf = &src->tf;