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. */
}
}
+ 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;
+ }
+
assert(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) {
err = 0;
switch (nal->type) {
case H264_NAL_IDR_SLICE:
- 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;
- }
idr(h); // FIXME ensure we don't lose some frames if there is reordering
case H264_NAL_SLICE:
sl->gb = nal->gb;