diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 02:33:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 02:33:10 +0200 |
commit | bcd1c2061211c7a4126db241229c5ecb71e05f80 (patch) | |
tree | c3b7126232526921f85552d154be58e0d7a71a66 | |
parent | b155fb08b8fe0c91dad406e740ec6d3cc25f3f82 (diff) | |
download | ffmpeg-bcd1c2061211c7a4126db241229c5ecb71e05f80.tar.gz |
avcodec/mjpegdec: support >8bit in mjpeg_decode_scan_progressive_ac()
Fixes Ticket2812
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mjpegdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 2528b795fe..4f68b9c3e5 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1182,6 +1182,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, int linesize = s->linesize[c]; int last_scan = 0; int16_t *quant_matrix = s->quant_matrixes[s->quant_sindex[0]]; + int bytes_per_pixel = 1 + (s->bits > 8); av_assert0(ss>=0 && Ah>=0 && Al>=0); if (se < ss || se > 63) { @@ -1223,7 +1224,9 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, if (last_scan) { s->dsp.idct_put(ptr, linesize, *block); - ptr += 8 >> s->avctx->lowres; + if (s->bits & 7) + shift_output(s, ptr, linesize); + ptr += bytes_per_pixel*8 >> s->avctx->lowres; } if (handle_rstn(s, 0)) EOBRUN = 0; |