diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 00:56:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 01:19:37 +0200 |
commit | 1deeb9437c9c0e1f9cb708b24a4d0dedaee7bab3 (patch) | |
tree | e15a30c9c9f4edff7a9b84eb92cf1bb06947ccdd /libavcodec/mjpegdec.c | |
parent | 15071ed4fc55b7cb048de7a5adc1cb41b7f8a8de (diff) | |
download | ffmpeg-1deeb9437c9c0e1f9cb708b24a4d0dedaee7bab3.tar.gz |
avcodec/mjpegdec: Fix normal jpeg with bits < 8
Untested due to lack of testcase
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-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) + |