[FFmpeg-cvslog] cdxl: set pix_fmt PAL8 only if palette is available

Paul B Mahol git at videolan.org
Mon Feb 27 04:47:10 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Feb 25 17:16:39 2012 +0000| [126daeb5507425d5e9906731d70015d79045d131] | committer: Justin Ruggles

cdxl: set pix_fmt PAL8 only if palette is available

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=126daeb5507425d5e9906731d70015d79045d131
---

 libavcodec/cdxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 01ebbcc..e23b934 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)))



More information about the ffmpeg-cvslog mailing list