Commit 126daeb5 authored by Paul B Mahol's avatar Paul B Mahol Committed by Justin Ruggles

cdxl: set pix_fmt PAL8 only if palette is available

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
parent 0a9efe4c
......@@ -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)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment