aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-07-04 14:15:01 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-05 19:59:49 +0200
commit865a34970e73b9c23e33fd6dc6ba046d4e821519 (patch)
tree35f4ba9a2843e6ca4e7271a2abc631be2a012610
parentea28ce9bc13803ccef97850388ddc9a73998a23e (diff)
downloadffmpeg-865a34970e73b9c23e33fd6dc6ba046d4e821519.tar.gz
avcodec/mjpegdec: Limit bayer to single plane outputting format
This reduces the number of paths reachable with DNG and should improve security Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mjpegdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index cb5e2a9b9b..e7a4e08c1c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -499,6 +499,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
}
}
+ if (s->bayer) {
+ if (pix_fmt_id != 0x11110000 && pix_fmt_id != 0x11000000)
+ goto unk_pixfmt;
+ }
+
switch (pix_fmt_id) {
case 0x11110000: /* for bayer-encoded huffman lossless JPEGs embedded in DNGs */
if (!s->bayer)