summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2016-08-03 17:45:36 -0700
committerTimothy Gu <timothygu99@gmail.com>2016-08-03 17:45:52 -0700
commit826c780c1209a8bd7e98ad2c532cbee86401e746 (patch)
tree3f4bfbc1d84c8f3bab88a128ca57dc5adf822e7c /libavcodec/h264_slice.c
parente4af9be0f45c8f2ca148fb971f1e0c6782530e8c (diff)
downloadffmpeg-streaming-826c780c1209a8bd7e98ad2c532cbee86401e746.zip
ffmpeg-streaming-826c780c1209a8bd7e98ad2c532cbee86401e746.tar.gz
Revert "Revert "Merge commit 'd1d7678040cd60148f97b372cb4291bcc45b2e22'""
This reverts commit e4af9be0f45c8f2ca148fb971f1e0c6782530e8c and redoes 796027f22154c799e0063e2457b31e0cfd1dddae. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index f32a74a..ade41f5 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1497,6 +1497,8 @@ 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. */
@@ -1829,6 +1831,11 @@ 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) {
OpenPOWER on IntegriCloud