[FFmpeg-cvslog] avcodec/jpeg2000dwt: Fix left shift of negative number

Andreas Rheinhardt git at videolan.org
Thu Sep 29 02:03:24 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Sep 27 01:09:59 2022 +0200| [fff010591b35874b4c7a7e9fe00d7541f0b7c994] | committer: Andreas Rheinhardt

avcodec/jpeg2000dwt: Fix left shift of negative number

Fixes the j2k-dwt FATE-test; also fixes #9945.
(I don't know whether the multiplication can overflow.)

Reviewed-by: Tomas Härdin <git at haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

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

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index f2da7307c4..34e33553f7 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -81,7 +81,7 @@ static void sd_1d53(int *p, int i0, int i1)
 
     if (i1 <= i0 + 1) {
         if (i0 == 1)
-            p[1] <<= 1;
+            p[1] *= 2;
         return;
     }
 



More information about the ffmpeg-cvslog mailing list