diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-22 21:17:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-02 19:41:48 +0100 |
commit | d3a1a59c22a196038bb4a4ed06e0e9ff98325a7f (patch) | |
tree | 9ff6934012a7a6c0caa81c26fac256ada08d036c /libavcodec | |
parent | b9be7f3adf0b53ae0d07e55529736fa3c2af3b1d (diff) | |
download | ffmpeg-d3a1a59c22a196038bb4a4ed06e0e9ff98325a7f.tar.gz |
avcodec/iff: finetune the palette size check in the mask case
Fixes: out of array access
Fixes: 15381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5668057826983936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0f9789c8e37eb6d166729e876729beb21b7d5647)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/iff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 9d1f9a77d1..c26bb97ab4 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -686,7 +686,7 @@ static int decode_frame(AVCodecContext *avctx, desc = av_pix_fmt_desc_get(avctx->pix_fmt); - if (!s->init && avctx->bits_per_coded_sample <= 8 && + if (!s->init && avctx->bits_per_coded_sample <= 8 - (s->masking == MASK_HAS_MASK) && avctx->pix_fmt == AV_PIX_FMT_PAL8) { if ((res = cmap_read_palette(avctx, (uint32_t *)s->frame->data[1])) < 0) return res; |