cdxl: set pix_fmt PAL8 only if palette is available

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
Paul B Mahol 2012-02-25 17:16:39 +00:00 committed by Justin Ruggles
parent 0a9efe4c6e
commit 126daeb550
1 changed files with 1 additions and 1 deletions

View File

@ -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)))