summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-22 21:17:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-23 10:51:16 +0200
commit0f9789c8e37eb6d166729e876729beb21b7d5647 (patch)
treeba62eead7982b857d9dd9f642a7b38491cb9b118 /libavcodec
parent92e8db532cdee3c73913174413428ffdc35032e2 (diff)
downloadffmpeg-streaming-0f9789c8e37eb6d166729e876729beb21b7d5647.zip
ffmpeg-streaming-0f9789c8e37eb6d166729e876729beb21b7d5647.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/iff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index b43bd50..4099d11 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -1514,7 +1514,7 @@ static int decode_frame(AVCodecContext *avctx,
buf_size -= bytestream2_tell(gb);
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 *)frame->data[1])) < 0)
return res;
OpenPOWER on IntegriCloud