aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-10-03 21:41:52 +0200
committerJanne Grunau <janne-libav@jannau.net>2012-10-03 22:08:49 +0200
commit1481e198251192c9801d4e7818c3c23bc217f705 (patch)
treee01783f7f50e36bda392212a362c1eb883145932 /libavcodec
parent45e5d0c3ac0d144cf4dc7fb3d852ee05814bbd2b (diff)
downloadffmpeg-1481e198251192c9801d4e7818c3c23bc217f705.tar.gz
mpegvideo: set extended_data in ff_update_duplicate_context()
AVFrame.extended_data has to reset to the AVFrame.data of the current thread context after copying the frame contents. Fixes crashes with frame-threading after 2bc0de38584.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 592b4f2b2e..ed40c10583 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -531,6 +531,7 @@ void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)
int ff_mpeg_update_thread_context(AVCodecContext *dst,
const AVCodecContext *src)
{
+ int i;
MpegEncContext *s = dst->priv_data, *s1 = src->priv_data;
if (dst == src || !s1->context_initialized)
@@ -572,6 +573,10 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
memcpy(&s->last_picture, &s1->last_picture,
(char *) &s1->last_picture_ptr - (char *) &s1->last_picture);
+ // reset s->picture[].f.extended_data to s->picture[].f.data
+ for (i = 0; i < s->picture_count; i++)
+ s->picture[i].f.extended_data = s->picture[i].f.data;
+
s->last_picture_ptr = REBASE_PICTURE(s1->last_picture_ptr, s, s1);
s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1);
s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1);