summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-12-18 18:00:31 +0100
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-12-18 18:00:31 +0100
commit06a436a224c00b97c0d2a173be2f5d792fd643db (patch)
treed510ccadb266b86baf826b9543712543109438fd
parent568e1b229b85050701e1ed4b8fa295b18995f67e (diff)
lavc/mjpegdec: Interpret three-component Adobe transform 0 also as RGB.
While there, make a comparison with "RGB" more readable. Fixes ticket #7625.
-rw-r--r--libavcodec/mjpegdec.c3
-rw-r--r--libavcodec/version.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 2f1635838a..4cab6608b1 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -488,7 +488,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->rgb)
s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_BGR48;
else {
- if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
+ if ( s->adobe_transform == 0
+ || s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
} else {
if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 802fc4a024..3c61e0c4ca 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 42
-#define LIBAVCODEC_VERSION_MICRO 103
+#define LIBAVCODEC_VERSION_MICRO 104
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \