diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 16:58:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 23:25:21 +0200 |
commit | deefa1580a563166e77d3a5832862b05a10944b1 (patch) | |
tree | ca45790315c35e8d180082e522c0cf33f55858cf | |
parent | b628942eefe420af4f657d0bb8b87faed861b450 (diff) | |
download | ffmpeg-deefa1580a563166e77d3a5832862b05a10944b1.tar.gz |
avcodec/shorten: Fix code depending on signed overflow behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d15588124ab1d4c0612cab66f02a716f1509211)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/shorten.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 5c4bf816b9..4e63274b39 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -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; |