diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-06 22:24:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-20 03:41:33 +0200 |
commit | 191e0f7e2b882eb20d696501603285c7192312f6 (patch) | |
tree | 85c43a052239dfce8d39ff4f60f8810a23bdcde0 | |
parent | 224ed78e726895b8b3344b86a4a17c7490ae9234 (diff) | |
download | ffmpeg-191e0f7e2b882eb20d696501603285c7192312f6.tar.gz |
avcodec/cdxl: Check format parameter
Fixes out of array access
Fixes: 1378/clusterfuzz-testcase-minimized-5715088008806400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e1b60aad77c27ed5d4dfc11e5e6a05a38c70489d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/cdxl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index 5958efeee3..bb42734d94 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -254,7 +254,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data, c->padded_bits = aligned_width - c->avctx->width; if (c->video_size < aligned_width * avctx->height * (int64_t)c->bpp / 8) return AVERROR_INVALIDDATA; - if (!encoding && c->palette_size && c->bpp <= 8) { + if (!encoding && c->palette_size && c->bpp <= 8 && c->format != CHUNKY) { avctx->pix_fmt = AV_PIX_FMT_PAL8; } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) { if (c->palette_size != (1 << (c->bpp - 1))) |