aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-28 04:26:10 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 16:17:40 +0200
commit37d8033fd064f417aa03313fbf12af70cb30856e (patch)
tree356d89fb7a247f0a2e9ffc7263576674a68e931d
parentc5a5b8055e27b90f9abe9b5379e6cf59d60240d8 (diff)
downloadffmpeg-37d8033fd064f417aa03313fbf12af70cb30856e.tar.gz
avcodec/jpeg2000dwt: Fix undefined shifts of negative numbers
Affected the vsynth*-jpeg2000 and the vsynth*-jpeg2000-97 FATE tests (where * ranges over { 1, 2, 3, _lena }) as well as ticket #7983. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5cf593adcd79a7c9502dc2725e1f0681ada36aef) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/jpeg2000dwt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 17d81dc56f..ecb4ba665c 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -255,7 +255,7 @@ static void dwt_encode97_int(DWTContext *s, int *t)
line += 5;
for (i = 0; i < w * h; i++)
- t[i] <<= I_PRESHIFT;
+ t[i] *= 1 << I_PRESHIFT;
for (lev = s->ndeclevels-1; lev >= 0; lev--){
int lh = s->linelen[lev][0],