Fixes: signed integer overflow: 6000 * -2147483648 cannot be represented in type 'int'
Fixes: 25700/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6578316302352384
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
{
WVContext *wc = ctx->priv_data;
int ret;
- int rate, rate_x, bpp, chan;
+ int rate, bpp, chan;
uint32_t chmask, flags;
+ unsigned rate_x;
wc->pos = avio_tell(pb);
if (id & 0x40)
avio_skip(pb, 1);
}
- if (rate == -1) {
+ if (rate == -1 || rate * (uint64_t)rate_x >= INT_MAX) {
av_log(ctx, AV_LOG_ERROR,
"Cannot determine custom sampling rate\n");
return AVERROR_INVALIDDATA;