From 85ca012ba680bdf942d95ab98c74f6a28f447588 Mon Sep 17 00:00:00 2001 From: Shiina Hideaki Date: Thu, 7 May 2015 01:46:55 +0100 Subject: [PATCH] mjpegenc: Fix JFIF header byte ordering The header had a wrong version description. Bug-Id: 808 Signed-off-by: Shiina Hideaki Signed-off-by: Vittorio Giovara --- libavcodec/mjpegenc_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index b1f2c00963..d9a5eda370 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -98,7 +98,10 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) put_marker(p, APP0); put_bits(p, 16, 16); avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */ - put_bits(p, 16, 0x0201); /* v 1.02 */ + /* The most significant byte is used for major revisions, the least + * significant byte for minor revisions. Version 1.02 is the current + * released revision. */ + put_bits(p, 16, 0x0102); put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ put_bits(p, 16, avctx->sample_aspect_ratio.num); put_bits(p, 16, avctx->sample_aspect_ratio.den);