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
1 changed files with 3 additions and 3 deletions

View File

@ -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) {