Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
h->slice_type = slice_type;
h->slice_type_nos = slice_type & 3;
h->slice_type = slice_type;
h->slice_type_nos = slice_type & 3;
+ if (h->nal_unit_type == NAL_IDR_SLICE &&
+ h->slice_type_nos != AV_PICTURE_TYPE_I) {
+ av_log(h->avctx, AV_LOG_ERROR, "A non-intra slice in an IDR NAL unit.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
// to make a few old functions happy, it's wrong though
h->pict_type = h->slice_type;
// to make a few old functions happy, it's wrong though
h->pict_type = h->slice_type;