[FFmpeg-cvslog] avcodec/shorten: Fix code depending on signed overflow behavior
Michael Niedermayer
git at videolan.org
Wed Jun 17 22:09:43 CEST 2015
ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 16:58:51 2015 +0200| [9f885733d6a9ab200d5bfdf7d09e929ad8c4a4ae] | 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=9f885733d6a9ab200d5bfdf7d09e929ad8c4a4ae
---
libavcodec/shorten.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 8b91ed3..98c1170 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