[FFmpeg-cvslog] avcodec/diracdec: Fix potential integer overflow

Michael Niedermayer git at videolan.org
Sun Jun 5 03:16:43 CEST 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Thu May 19 18:02:53 2016 +0200| [4d9fdca05319ec84c3052521b6693ce59fd2e0d9] | committer: Michael Niedermayer

avcodec/diracdec: Fix potential integer overflow

Fixes CID1361948

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 7ecfe4dc363435c81e66dd14881dc0b0ccc73fb1)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/diracdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 05c7900..1d7bb9b 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -903,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
     } else {
         for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
             for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
-                bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
-                    - slice_num    * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
+                bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
+                       - slice_num    * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
                 slices[slice_num].bytes   = bytes;
                 slices[slice_num].slice_x = slice_x;
                 slices[slice_num].slice_y = slice_y;



More information about the ffmpeg-cvslog mailing list