Commit c40f51e1 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 30db867c
...@@ -746,7 +746,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, ...@@ -746,7 +746,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
int first_slice) int first_slice)
{ {
int i, ret; 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; int mmco_index = 0;
if (h->nal_unit_type == NAL_IDR_SLICE) { // FIXME fields if (h->nal_unit_type == NAL_IDR_SLICE) { // FIXME fields
...@@ -812,6 +812,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, ...@@ -812,6 +812,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
} }
if (first_slice && mmco_index != -1) { if (first_slice && mmco_index != -1) {
memcpy(h->mmco, mmco_temp, sizeof(h->mmco));
h->mmco_index = mmco_index; h->mmco_index = mmco_index;
} else if (!first_slice && mmco_index >= 0 && } else if (!first_slice && mmco_index >= 0 &&
(mmco_index != h->mmco_index || (mmco_index != h->mmco_index ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment