mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-02-26 07:45:45 +00:00
avcodec/h264_ps: Move truncation check from VUI to SPS
This more completely checks for truncation Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
48f27b78f4
commit
32e06c485b
@ -241,12 +241,6 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_bits_left(&h->gb) < 0) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
|
||||||
"Overread VUI by %d bits\n", -get_bits_left(&h->gb));
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,6 +517,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get_bits_left(&h->gb) < 0) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
|
"Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(&h->gb));
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sps->sar.den)
|
if (!sps->sar.den)
|
||||||
sps->sar.den = 1;
|
sps->sar.den = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user