Commit ef73ccc2 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/h264_refs: do not use invalid mmco values in case of error

Change one relevant assert to av_assert0 while here.
parent 428b4aac
...@@ -732,7 +732,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h) ...@@ -732,7 +732,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
for (j = 0; j < MAX_DELAYED_PIC_COUNT; j++) for (j = 0; j < MAX_DELAYED_PIC_COUNT; j++)
h->last_pocs[j] = INT_MIN; h->last_pocs[j] = INT_MIN;
break; break;
default: assert(0); default: av_assert0(0);
} }
} }
...@@ -868,6 +868,7 @@ int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb, ...@@ -868,6 +868,7 @@ int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb,
av_log(logctx, AV_LOG_ERROR, av_log(logctx, AV_LOG_ERROR,
"illegal long ref in memory management control " "illegal long ref in memory management control "
"operation %d\n", opcode); "operation %d\n", opcode);
sl->nb_mmco = i;
return -1; return -1;
} }
mmco[i].long_arg = long_arg; mmco[i].long_arg = long_arg;
...@@ -877,6 +878,7 @@ int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb, ...@@ -877,6 +878,7 @@ int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb,
av_log(logctx, AV_LOG_ERROR, av_log(logctx, AV_LOG_ERROR,
"illegal memory management control operation %d\n", "illegal memory management control operation %d\n",
opcode); opcode);
sl->nb_mmco = i;
return -1; return -1;
} }
if (opcode == MMCO_END) if (opcode == MMCO_END)
......
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