diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 7ca1601086..2360d7ff80 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -1283,7 +1283,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx, while (srcgb, s->buffer, s->buffer_size); + init_get_bits(&s->gb, s->buffer, dst - s->buffer); } else init_get_bits(&s->gb, buf_ptr, buf_end - buf_ptr);