Commit 2d155881 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/shorten: Fix code depending on signed overflow behavior

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d201becf
......@@ -129,8 +129,7 @@ static int allocate_buffers(ShortenContext *s)
av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");
return AVERROR_INVALIDDATA;
}
if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||
s->blocksize + s->nwrap <= (unsigned)s->nwrap) {
if (s->blocksize + (uint64_t)s->nwrap >= UINT_MAX / sizeof(int32_t)) {
av_log(s->avctx, AV_LOG_ERROR,
"s->blocksize + s->nwrap too large\n");
return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment