diff options
author | Michael Niedermayer <[email protected]> | 2015-05-15 16:58:51 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-05-21 20:43:39 +0200 |
commit | d2fbf8b5691fe3dc58137c06135fd44286f81f5e (patch) | |
tree | a8f9d2545401517f06383c3428c43fee132d1e34 | |
parent | c14359f24d612e4de7ac4c47c47965ec01bedb9b (diff) |
avcodec/shorten: Fix code depending on signed overflow behavior
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 2d15588124ab1d4c0612cab66f02a716f1509211)
Signed-off-by: Michael Niedermayer <[email protected]>
-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 4c9cc0636c..925d9ca213 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; |