Signed-off-by: Paul B Mahol <[email protected]>
---
 libavcodec/cdxl.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 01ebbcc..cbb9976 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -197,10 +197,6 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void 
*data,
         return AVERROR_INVALIDDATA;
     if (c->bpp < 1)
         return AVERROR_INVALIDDATA;
-    if (c->bpp > 8) {
-        av_log_ask_for_sample(avctx, "unsupported pixel size: %d\n", c->bpp);
-        return AVERROR_PATCHWELCOME;
-    }
     if (format) {
         av_log_ask_for_sample(avctx, "unsupported pixel format: %d\n", format);
         return AVERROR_PATCHWELCOME;
@@ -213,7 +209,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)))
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to