Check format for BGR24
This commit is contained in:
@@ -256,7 +256,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (!encoding && c->palette_size && c->bpp <= 8) {
|
if (!encoding && c->palette_size && c->bpp <= 8) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
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)))
|
if (c->palette_size != (1 << (c->bpp - 1)))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (!encoding && c->palette_size && c->bpp <= 8) {
|
if (!encoding && c->palette_size && c->bpp <= 8) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
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)))
|
if (c->palette_size != (1 << (c->bpp - 1)))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||||
|
|||||||
Reference in New Issue
Block a user