mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/dynamic_hdr10_plus: check size before using it
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
parent
4c079636ab
commit
a487635b85
|
@ -40,10 +40,10 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
s->application_version = get_bits(gb, 8);
|
if (get_bits_left(gb) < 10)
|
||||||
|
|
||||||
if (get_bits_left(gb) < 2)
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
|
s->application_version = get_bits(gb, 8);
|
||||||
s->num_windows = get_bits(gb, 2);
|
s->num_windows = get_bits(gb, 2);
|
||||||
|
|
||||||
if (s->num_windows < 1 || s->num_windows > 3) {
|
if (s->num_windows < 1 || s->num_windows > 3) {
|
||||||
|
|
Loading…
Reference in New Issue