summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2014-06-11 19:40:28 +0200
committerJanne Grunau <janne-libav@jannau.net>2014-06-11 21:28:27 +0200
commit0ddc53dabbc6f636d062b187ea27934610aaad30 (patch)
treee591547f2e77c613d079ebc90e635ee7aa20215d /libavcodec/mpegvideo.c
parent641e57230b460bef52c88e61087d97c223910bea (diff)
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@videolan.org>.
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 49bc70c28b..aea6321518 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;