diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 16:58:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 17:41:47 +0200 |
commit | f33bd39d27424ed2d21e8059abc2506c5e0a5fbd (patch) | |
tree | 2b7e6d1a429327bda14bfba21bdc4a2ea47b4afe | |
parent | 03377703525a3ec86d6b8cb5f8ef75e6851f914c (diff) | |
download | ffmpeg-f33bd39d27424ed2d21e8059abc2506c5e0a5fbd.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 deae0fa1ce..804efe3580 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; |