Module: libav
Branch: release/11
Commit: e31fa099f3ae0aad219755216ba5268b02e28608

Author:    Luca Barbato <lu_z...@gentoo.org>
Committer: Sean McGovern <gsean...@gmail.com>
Date:      Mon Apr 17 19:11:57 2017 +0000

mjpeg: Report non-3 component rgb lossless as not supported

Bug-Id: 1043
(cherry picked from commit f2c469b73f8ac3dd6a98d38281f61b68ea6dd336)

Signed-off-by: Sean McGovern <gsean...@gmail.com>

---

 libavcodec/mjpegdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 9118df6..6412340 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1103,6 +1103,12 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const 
uint8_t *mb_bitmask,
     for (i = s->mjpb_skiptosod; i > 0; i--)
         skip_bits(&s->gb, 8);
 
+    if (s->lossless && s->rgb && nb_components != 3) {
+        avpriv_request_sample(s->avctx,
+                              "Lossless RGB image without 3 components");
+        return AVERROR_PATCHWELCOME;
+    }
+
 next_field:
     for (i = 0; i < nb_components; i++)
         s->last_dc[i] = 1024;

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to