[FFmpeg-cvslog] avcodec/mjpegdec: Check for non ls PAL8
Michael Niedermayer
git at videolan.org
Thu Jun 27 20:48:53 EEST 2019
ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 1 19:06:07 2019 +0200| [1a022c66c827d8f3192c6c1d1dca0c679b8cff92] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 442375fee7f1fb15e42fbc128dc38bdfcc2cc105)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a022c66c827d8f3192c6c1d1dca0c679b8cff92
---
libavcodec/mjpegdec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 53598fdb3c..d61a69b437 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -704,7 +704,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;
}
More information about the ffmpeg-cvslog
mailing list