summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/cdxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 01ebbccc19..e23b93421a 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -213,7 +213,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
if (c->video_size < FFALIGN(avctx->width, 16) * avctx->height * c->bpp / 8)
return AVERROR_INVALIDDATA;
- if (encoding == 0) {
+ if (!encoding && c->palette_size && c->bpp <= 8) {
avctx->pix_fmt = PIX_FMT_PAL8;
} else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
if (c->palette_size != (1 << (c->bpp - 1)))