diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-01 20:06:07 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 01:30:37 +0300 |
commit | b8bb86efe7e1f107f2001e1aea3c5839c5dcaa58 (patch) | |
tree | 13ae65303ea9a1f90b330fa0bd8089d22428b63e /libavcodec/mjpegdec.c | |
parent | 84b444aa781a6c69947354cde0146e943888e242 (diff) |
avcodec/mjpegdec: Check for non ls PAL8
Fixes: Null-dereference READ in av_malloc
Fixes: 15002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5643474625363968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 442375fee7f1fb15e42fbc128dc38bdfcc2cc105)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 4498bf8be7..4572dcfd61 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -668,7 +668,9 @@ unk_pixfmt: } if ((s->rgb && !s->lossless && !s->ls) || - (!s->rgb && s->ls && s->nb_components > 1)) { + (!s->rgb && s->ls && s->nb_components > 1) || + (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 && !s->ls) + ) { av_log(s->avctx, AV_LOG_ERROR, "Unsupported coding and pixel format combination\n"); return AVERROR_PATCHWELCOME; } |