summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2017-05-08 11:46:03 +0200
committerMichael Niedermayer <[email protected]>2017-05-20 03:41:33 +0200
commitff342d0587d6c821745d87bf662b53e90768ca21 (patch)
tree95ffe6b999b68a33b28e3e8e4c45f8236fd810d9
parent1116de7ba78edfb966e78caa17fb5a8a09e8a62e (diff)
avcodec/cdxl: Check format for BGR24
Fixes: out of array access Fixes: 1427/clusterfuzz-testcase-minimized-5020737339392000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 1e42736b95065c69a7481d0cf55247024f54b660) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/cdxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index bb42734d94..3eaf194d2f 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -256,7 +256,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
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)) {
+ } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8) && c->format != CHUNKY) {
if (c->palette_size != (1 << (c->bpp - 1)))
return AVERROR_INVALIDDATA;
avctx->pix_fmt = AV_PIX_FMT_BGR24;