diff --git a/libavformat/wvdec.c b/libavformat/wvdec.c index 2060523c3b..8ddebf8033 100644 --- a/libavformat/wvdec.c +++ b/libavformat/wvdec.c @@ -81,6 +81,7 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb) int ret; int rate, bpp, chan; uint32_t chmask, flags; + unsigned rate_x; wc->pos = avio_tell(pb); @@ -179,7 +180,7 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *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;