summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/mjpegenc_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index 31868c9bed..37c15367a4 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -275,7 +275,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
default: av_assert0(0);
}
- put_bits(pb, 16, 17);
+ put_bits(pb, 16, 8 + 3 * components);
if (lossless && ( avctx->pix_fmt == AV_PIX_FMT_BGR0
|| avctx->pix_fmt == AV_PIX_FMT_BGRA
|| avctx->pix_fmt == AV_PIX_FMT_BGR24))