avcodec/mjpegdec: Fix undefined shift
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Apr 2014 03:32:56 +0000 (05:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Jun 2014 23:50:05 +0000 (01:50 +0200)
Fixes CID1194388

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4329605289e25bb071ec1c1182bf25fc83b09aa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index 9292351..9aee595 100644 (file)
@@ -1111,7 +1111,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
         return AVERROR_INVALIDDATA;
 
     if (!Al) {
-        s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
+        s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
         last_scan = !~s->coefs_finished[c];
     }