diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-05 10:29:55 -0500 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-06 10:44:46 -0500 |
commit | 199d9f995da53fe2507821f6d96bbc692574e1a9 (patch) | |
tree | 86cf9d59653c55e26e4813ced350ca4d90867043 | |
parent | ac4a5e3abd8a022ab32245ad527ffc37eabab8b1 (diff) | |
download | ffmpeg-199d9f995da53fe2507821f6d96bbc692574e1a9.tar.gz |
mjpegdec: fix undefined shift
Add a comment to explain the code.
CC: libav-stable@libav.org
Bug-Id: CID 1194388
-rw-r--r-- | libavcodec/mjpegdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index d9a73d8426..01e11bee17 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -964,7 +964,9 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width * s->mb_height); if (!Al) { - s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss); + // s->coefs_finished is a bitmask for coefficients coded + // ss and se are parameters telling start and end coefficients + s->coefs_finished[c] |= (~0ULL >> (63 - (se - ss))) << ss; last_scan = !~s->coefs_finished[c]; } |