[FFmpeg-cvslog] avcodec/takdec: Fix integer overflow in decode_subframe()

Michael Niedermayer git at videolan.org
Thu Oct 26 20:07:40 EEST 2017


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 27 23:49:26 2017 +0200| [43d7b1e42fd7b5e9d9f79bfe1171791a9b7566c3] | committer: Michael Niedermayer

avcodec/takdec: Fix integer overflow in decode_subframe()

Fixes: runtime error: signed integer overflow: -536870912 - 1972191120 cannot be represented in type 'int'
Fixes: 2711/clusterfuzz-testcase-minimized-4975142398590976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 2c630d159ffe8a9822e81f9c041652762b37e068)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/takdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 4154f0a1e2..868f43bcba 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -480,7 +480,7 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded,
                      s->residues[i + j + 1] * s->filter[j + 1] +
                      s->residues[i + j    ] * s->filter[j    ];
             }
-            v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - *decoded;
+            v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - (unsigned)*decoded;
             *decoded++ = v;
             s->residues[filter_order + i] = v >> dshift;
         }



More information about the ffmpeg-cvslog mailing list