avcodec/bonk: Check step against overflow

No testcase

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-11-06 11:26:51 +01:00
parent 9f00286c4c
commit 3263185225
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -180,6 +180,8 @@ static int intlist_read(BonkContext *s, int *buf, int entries, int base_2_part)
if (!dominant)
n_zeros += steplet;
if (step > INT32_MAX*8LL/9 + 1)
return AVERROR_INVALIDDATA;
step += step / 8;
} else if (steplet > 0) {
int actual_run = read_uint_max(s, steplet - 1);