aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-28 10:54:35 +0100
committerAnton Khirnov <anton@khirnov.net>2014-01-03 16:36:43 +0100
commitfeded990e3ef9af4a0b827d5b6d8fe86f0b94942 (patch)
tree6e975bb334fc9e6797b4fecf116c7076e6857550 /libavcodec
parent58f0d164def52147e9a9ee4dad9fe8d0d334623f (diff)
downloadffmpeg-feded990e3ef9af4a0b827d5b6d8fe86f0b94942.tar.gz
mpegvideo: set reference/pict_type on generated reference frames
Otherwise the generic code will unref them, which can then result in last_picture_ptr == current_picture_ptr, which causes deadlocks at least in rv40. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f39cdca3da..f34c81dd0f 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1540,6 +1540,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return i;
}
s->last_picture_ptr = &s->picture[i];
+
+ s->last_picture_ptr->reference = 3;
+ s->last_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
+
if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
s->last_picture_ptr = NULL;
return -1;
@@ -1567,6 +1571,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return i;
}
s->next_picture_ptr = &s->picture[i];
+
+ s->next_picture_ptr->reference = 3;
+ s->next_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
+
if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
s->next_picture_ptr = NULL;
return -1;