aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-04 20:21:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 00:52:56 +0100
commitc8b90c7cd52600bbfb403793d6665fc90ad78946 (patch)
tree7075a2073ae5cda86b2cfbae25d4b92236c22ab8
parent97978b7ae8e9313365e0702fe60e226b3c3e0dae (diff)
downloadffmpeg-c8b90c7cd52600bbfb403793d6665fc90ad78946.tar.gz
h264: Always decode MMCOs into temprary array
When decoding succeeded the array is copied into the permanent one. This prevents inconsistencies Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit c40f51e15b91898e5c69fca7c8c67e3da6624dd4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264_refs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 2ba36b632c..196dcfbaeb 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -696,7 +696,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
int first_slice)
{
int i, ret;
- MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
+ MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = mmco_temp;
int mmco_index = 0;
if (h->nal_unit_type == NAL_IDR_SLICE){ // FIXME fields
@@ -762,6 +762,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
}
if (first_slice && mmco_index != -1) {
+ memcpy(h->mmco, mmco_temp, sizeof(h->mmco));
h->mmco_index = mmco_index;
} else if (!first_slice && mmco_index >= 0 &&
(mmco_index != h->mmco_index ||