[FFmpeg-cvslog] mpegvideo: synchronize AVFrame pointers in ERContext fully

Janne Grunau git at videolan.org
Wed Jun 11 22:38:08 CEST 2014


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Wed Jun 11 19:40:28 2014 +0200| [0ddc53dabbc6f636d062b187ea27934610aaad30] | committer: Janne Grunau

mpegvideo: synchronize AVFrame pointers in ERContext fully

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 at videolan.org>.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ddc53dabbc6f636d062b187ea27934610aaad30
---

 libavcodec/mpegvideo.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 49bc70c..aea6321 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -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;



More information about the ffmpeg-cvslog mailing list