Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-07-04 15:15:01 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-09 13:35:39 +0300
commit11a10e30a92986a4666ea831976c44f9ebb4de71 (patch)
treef56b39ce91a716c84446243b624bcb422a4fe404 /libavcodec
parentf98f29de5ea4fdd09b2e834734259652f28c116c (diff)
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> (cherry picked from commit 865a34970e73b9c23e33fd6dc6ba046d4e821519) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-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)