diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 4f68b9c3e5..8c4e916f1a 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1047,13 +1047,14 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s, static void shift_output(MJpegDecodeContext *s, uint8_t *ptr, int linesize) { int block_x, block_y; + int size = 8 >> s->avctx->lowres; if (s->bits > 8) { - for (block_y=0; block_y<8; block_y++) - for (block_x=0; block_x<8; block_x++) + for (block_y=0; block_ybits; } else { - for (block_y=0; block_y<8; block_y++) - for (block_x=0; block_x<8; block_x++) + for (block_y=0; block_ybits; } }