[FFmpeg-cvslog] avcodec/mjpegdec: Only allow 0x11110000 pix_fmt_id for bayer mode
Michael Niedermayer
git at videolan.org
Sat Sep 14 00:07:29 EEST 2019
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 12 21:02:17 2019 +0200| [2006e5ccb6db3d4fd97096d8a1d0ba18f708f5fe] | committer: Michael Niedermayer
avcodec/mjpegdec: Only allow 0x11110000 pix_fmt_id for bayer mode
Fixes: NULL pointer dereference
Fixes: assertion failure
Fixes: 17003/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5696929253556224
Fixes: 17039/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5651008134316032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2006e5ccb6db3d4fd97096d8a1d0ba18f708f5fe
---
libavcodec/mjpegdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 1f2fabe2df..5a80b7d289 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -501,6 +501,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
switch (pix_fmt_id) {
case 0x11110000: /* for bayer-encoded huffman lossless JPEGs embedded in DNGs */
+ if (!s->bayer)
+ goto unk_pixfmt;
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
break;
case 0x11111100:
More information about the ffmpeg-cvslog
mailing list