avcodec/mjpegdec: Fix negative shift
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 10 Jan 2016 14:52:09 +0000 (15:52 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 15 Jan 2016 15:00:31 +0000 (16:00 +0100)
Fixes: mjpeg_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d86d7b2486cd5c31db8e820d8a89554abf19567e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mjpegdec.c

index c28f07d..2e0a568 100644 (file)
@@ -994,7 +994,7 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
                     return -1;
 
                 left[i] = buffer[mb_x][i] =
-                    mask & (pred + (dc << point_transform));
+                    mask & (pred + (dc * (1 << point_transform)));
             }
 
             if (s->restart_interval && !--s->restart_count) {