aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-08 11:46:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 00:21:49 +0200
commita483e46b794539d21b1ec0f3e521f681a54a86d2 (patch)
treea53a85e31910aacdb2d41d249bc8789551c7a5df /libavcodec
parent97eb92b27681be07b3c04f2f61c18668e05dd902 (diff)
downloadffmpeg-a483e46b794539d21b1ec0f3e521f681a54a86d2.tar.gz
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 <michael@niedermayer.cc> (cherry picked from commit 1e42736b95065c69a7481d0cf55247024f54b660) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cdxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 5c0ecb279c..78f5d50102 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -279,7 +279,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;