diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 02:56:44 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 03:19:37 +0400 |
commit | 1deeb9437c9c0e1f9cb708b24a4d0dedaee7bab3 (patch) | |
tree | e15a30c9c9f4edff7a9b84eb92cf1bb06947ccdd | |
parent | 15071ed4fc55b7cb048de7a5adc1cb41b7f8a8de (diff) |
avcodec/mjpegdec: Fix normal jpeg with bits < 8
Untested due to lack of testcase
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mjpegdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index a1b7e8a6e9..0d619efe49 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1121,6 +1121,12 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, return AVERROR_INVALIDDATA; } s->dsp.idct_put(ptr, linesize[c], s->block); + if (s->bits & 7) { + int block_x, block_y; + for (block_y=0; block_y<8; block_y++) + for (block_x=0; block_x<8; block_x++) + *(ptr + 2*block_x + block_y*linesize[c]) <<= 8 - s->bits; + } } } else { int block_idx = s->block_stride[c] * (v * mb_y + y) + |