[FFmpeg-cvslog] avcodec/mjpegdec: Limit bayer to single plane outputting format
Michael Niedermayer
git at videolan.org
Mon Jul 6 02:43:04 EEST 2020
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jul 4 14:15:01 2020 +0200| [865a34970e73b9c23e33fd6dc6ba046d4e821519] | committer: Michael Niedermayer
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 at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=865a34970e73b9c23e33fd6dc6ba046d4e821519
---
libavcodec/mjpegdec.c | 5 +++++
1 file changed, 5 insertions(+)
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)
More information about the ffmpeg-cvslog
mailing list