From e4af9be0f45c8f2ca148fb971f1e0c6782530e8c Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Wed, 3 Aug 2016 17:06:43 -0700 Subject: Revert "Merge commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22'" This reverts commit 796027f22154c799e0063e2457b31e0cfd1dddae, reversing changes made to bca30ed2b67f095fd31e07319a622ac30ad22978. Preemptive revert before further testing has been done. --- libavcodec/h264_slice.c | 7 ------- libavcodec/h264dec.c | 6 ++++++ libavcodec/h264dec.h | 5 ----- 3 files changed, 6 insertions(+), 12 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index ade41f5d35..f32a74aea0 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1497,8 +1497,6 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, h->nb_mmco = sl->nb_mmco; h->explicit_ref_marking = sl->explicit_ref_marking; - h->picture_idr = nal->type == H264_NAL_IDR_SLICE; - /* Set the frame properties/side data. Only done for the second field in * field coded frames, since some SEI information is present for each field * and is merged by the SEI parsing code. */ @@ -1831,11 +1829,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, } } - if (h->picture_idr && nal->type != H264_NAL_IDR_SLICE) { - av_log(h->avctx, AV_LOG_ERROR, "Invalid mix of IDR and non-IDR slices\n"); - return AVERROR_INVALIDDATA; - } - av_assert1(h->mb_num == h->mb_width * h->mb_height); if (sl->first_mb_addr << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num || sl->first_mb_addr >= h->mb_num) { diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 977977431e..323639dc19 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -783,6 +783,12 @@ again: ret = -1; goto end; } + if (nal->type != H264_NAL_IDR_SLICE) { + av_log(h->avctx, AV_LOG_ERROR, + "Invalid mix of idr and non-idr slices\n"); + ret = -1; + goto end; + } if(!idr_cleared) { if (h->current_slice && (avctx->active_thread_type & FF_THREAD_SLICE)) { av_log(h, AV_LOG_ERROR, "invalid mixed IDR / non IDR frames cannot be decoded in slice multithreading mode\n"); diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 3034a933c2..9483efbc43 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -384,11 +384,6 @@ typedef struct H264Context { */ int postpone_filter; - /* - * Set to 1 when the current picture is IDR, 0 otherwise. - */ - int picture_idr; - int8_t(*intra4x4_pred_mode); H264PredContext hpc; -- cgit v1.2.3