You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/mjpegdec: Fix order of condition for pal8
Fixes: out of array access Fixes: 33960/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5052852809629696 Fixes: 34163/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-6123678099177472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -681,7 +681,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
} else if (s->nb_components != 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
} else if (s->palette_index && s->bits <= 8 || s->force_pal8)
|
||||
} else if ((s->palette_index || s->force_pal8) && s->bits <= 8)
|
||||
s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
else if (s->bits <= 8)
|
||||
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||
|
Reference in New Issue
Block a user