[FFmpeg-cvslog] avcodec/shorten: Fix code depending on signed overflow behavior

Michael Niedermayer git at videolan.org
Tue Jun 2 00:50:13 CEST 2015


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 16:58:51 2015 +0200| [deefa1580a563166e77d3a5832862b05a10944b1] | committer: Michael Niedermayer

avcodec/shorten: Fix code depending on signed overflow behavior

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=deefa1580a563166e77d3a5832862b05a10944b1
---

 libavcodec/shorten.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 5c4bf81..4e63274 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;



More information about the ffmpeg-cvslog mailing list