aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-01-26 10:30:24 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-01-26 10:30:24 +0000
commitddee80f38400897b2877c6715cb5d2754319760c (patch)
tree7b43d3ece28a364cb93f7ec04cc4ce8fa68ffcfe
parent60222557746d66288f4231ed6ce1bfce7d98de3a (diff)
downloadffmpeg-ddee80f38400897b2877c6715cb5d2754319760c.tar.gz
Metasoft MJPEG codec has Cb and Cr swapped, fixes issue 1611.
Originally committed as revision 21451 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mjpegdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index dc8df55d47..c0afb985b6 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -920,6 +920,10 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s)
av_log(s->avctx, AV_LOG_ERROR, "decode_sos: index(%d) out of components\n", index);
return -1;
}
+ /* Metasoft MJPEG codec has Cb and Cr swapped */
+ if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J')
+ && nb_components == 3 && s->nb_components == 3 && i)
+ index = 3 - i;
s->comp_index[i] = index;