memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8));
sps->scaling_matrix_present = 0;
- if(sps->profile_idc >= 100){ //high profile
+ if (sps->profile_idc == 100 || sps->profile_idc == 110 ||
+ sps->profile_idc == 122 || sps->profile_idc == 244 ||
+ sps->profile_idc == 44 || sps->profile_idc == 83 ||
+ sps->profile_idc == 86 || sps->profile_idc == 118 ||
+ sps->profile_idc == 128 || sps->profile_idc == 144) {
sps->chroma_format_idc= get_ue_golomb_31(&s->gb);
if(sps->chroma_format_idc > 3) {
av_log(h->s.avctx, AV_LOG_ERROR, "chroma_format_idc (%u) out of range\n", sps->chroma_format_idc);
av_log(h->s.avctx, AV_LOG_ERROR,
"log2_max_frame_num_minus4 out of range (0-12): %d\n",
log2_max_frame_num_minus4);
- return AVERROR_INVALIDDATA;
+ goto fail;
}
sps->log2_max_frame_num = log2_max_frame_num_minus4 + 4;
sps->crop_right = get_ue_golomb(&s->gb);
sps->crop_top = get_ue_golomb(&s->gb);
sps->crop_bottom= get_ue_golomb(&s->gb);
+ if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
+ av_log(h->s.avctx, AV_LOG_DEBUG,
+ "discarding sps cropping, "
+ "original values are l:%u r:%u t:%u b:%u\n",
+ sps->crop_left,
+ sps->crop_right,
+ sps->crop_top,
+ sps->crop_bottom);
+
+ sps->crop_left =
+ sps->crop_right =
+ sps->crop_top =
+ sps->crop_bottom = 0;
+ }
if(sps->crop_left || sps->crop_top){
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
}