From fff010591b35874b4c7a7e9fe00d7541f0b7c994 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 27 Sep 2022 01:09:59 +0200 Subject: [PATCH] avcodec/jpeg2000dwt: Fix left shift of negative number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the j2k-dwt FATE-test; also fixes #9945. (I don't know whether the multiplication can overflow.) Reviewed-by: Tomas Härdin Signed-off-by: Andreas Rheinhardt --- 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; }