summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2015-05-15 16:58:51 +0200
committerMichael Niedermayer <[email protected]>2015-05-21 20:43:39 +0200
commitd2fbf8b5691fe3dc58137c06135fd44286f81f5e (patch)
treea8f9d2545401517f06383c3428c43fee132d1e34
parentc14359f24d612e4de7ac4c47c47965ec01bedb9b (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.c3
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;