[FFmpeg-cvslog] avcodec/jpeg2000dwt: Fix integer overflow in dwt_decode97_int()

Michael Niedermayer git at videolan.org
Thu Aug 24 15:07:51 EEST 2017


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 26 15:05:08 2017 +0200| [a6e90e5998ab15de7505b8ac7f7e094244581b51] | committer: Michael Niedermayer

avcodec/jpeg2000dwt: Fix integer overflow in dwt_decode97_int()

Fixes: runtime error: signed integer overflow: -163654656 * 256 cannot be represented in type 'int'
Fixes: 2367/clusterfuzz-testcase-minimized-4648678897745920

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 ea5366670e26b2c6c396e6a5f49827a2b71e6dd6)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 2bb245d25b..38a578af3d 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -488,7 +488,7 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
     line += 5;
 
     for (i = 0; i < w * h; i++)
-        data[i] *= 1 << I_PRESHIFT;
+        data[i] *= 1LL << I_PRESHIFT;
 
     for (lev = 0; lev < s->ndeclevels; lev++) {
         int lh = s->linelen[lev][0],



More information about the ffmpeg-cvslog mailing list