Browse Source

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>
tags/n4.2
Michael Niedermayer 6 years ago
parent
commit
442375fee7
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/mjpegdec.c

+ 3
- 1
libavcodec/mjpegdec.c View File

@@ -719,7 +719,9 @@ unk_pixfmt:
} }


if ((s->rgb && !s->lossless && !s->ls) || 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"); av_log(s->avctx, AV_LOG_ERROR, "Unsupported coding and pixel format combination\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }


Loading…
Cancel
Save