1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avcodec/h264: Do not get stuck on IDR inter frames

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-08-31 03:43:56 +02:00
parent 8c63a0d171
commit e0237208b4

View File

@@ -1567,6 +1567,12 @@ again:
switch (hx->nal_unit_type) { switch (hx->nal_unit_type) {
case NAL_IDR_SLICE: case NAL_IDR_SLICE:
if ((ptr[0] & 0xFC) == 0x98) {
av_log(h->avctx, AV_LOG_ERROR, "Invalid inter IDR frame\n");
h->next_outputed_poc = INT_MIN;
ret = -1;
goto end;
}
if (h->nal_unit_type != NAL_IDR_SLICE) { if (h->nal_unit_type != NAL_IDR_SLICE) {
av_log(h->avctx, AV_LOG_ERROR, av_log(h->avctx, AV_LOG_ERROR,
"Invalid mix of idr and non-idr slices\n"); "Invalid mix of idr and non-idr slices\n");