Browse Source

avcodec/shorten: Fix code depending on signed overflow behavior

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d15588124)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.10
Michael Niedermayer 10 years ago
parent
commit
deefa1580a
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      libavcodec/shorten.c

+ 1
- 2
libavcodec/shorten.c View File

@@ -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;


Loading…
Cancel
Save