diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 02:08:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 03:23:58 +0100 |
commit | 01a0283c92b124f185ce4e814a1c5b600f1135e0 (patch) | |
tree | 8b428701b03da1f5d9aca28d0e56384e9f46b1d8 /libavcodec/h264_refs.c | |
parent | c69acbf8813e3ef806847777e878ff1962e5c72a (diff) | |
download | ffmpeg-01a0283c92b124f185ce4e814a1c5b600f1135e0.tar.gz |
h264: disallow single unpaired fields as references of frames
Fixes deadlock
Diffstat (limited to 'libavcodec/h264_refs.c')
-rw-r--r-- | libavcodec/h264_refs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 190aee5278..e8f252bf8e 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -293,12 +293,14 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h){ } for(list=0; list<h->list_count; list++){ for(index= 0; index < h->ref_count[list]; index++){ - if (!h->ref_list[list][index].f.data[0]) { + if ( !h->ref_list[list][index].f.data[0] + || (!FIELD_PICTURE && (h->ref_list[list][index].reference&3) != 3)) { int i; av_log(h->avctx, AV_LOG_ERROR, "Missing reference picture, default is %d\n", h->default_ref_list[list][0].poc); for (i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++) h->last_pocs[i] = INT_MIN; - if (h->default_ref_list[list][0].f.data[0]) + if (h->default_ref_list[list][0].f.data[0] + && !(!FIELD_PICTURE && (h->default_ref_list[list][index].reference&3) != 3)) COPY_PICTURE(&h->ref_list[list][index], &h->default_ref_list[list][0]); else return -1; |