From 126daeb5507425d5e9906731d70015d79045d131 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 25 Feb 2012 17:16:39 +0000 Subject: cdxl: set pix_fmt PAL8 only if palette is available Signed-off-by: Paul B Mahol Signed-off-by: Justin Ruggles --- libavcodec/cdxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/cdxl.c') 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))) -- cgit v1.2.3