1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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:
Limin Wang 2021-09-13 20:27:05 +08:00
parent 4c079636ab
commit a487635b85

View File

@ -40,10 +40,10 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
if (ret < 0)
return ret;
s->application_version = get_bits(gb, 8);
if (get_bits_left(gb) < 2)
if (get_bits_left(gb) < 10)
return AVERROR_INVALIDDATA;
s->application_version = get_bits(gb, 8);
s->num_windows = get_bits(gb, 2);
if (s->num_windows < 1 || s->num_windows > 3) {