[FFmpeg-devel] [PATCH]Set palette for 1bit PCX

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Nov 11 11:01:37 CET 2011


Hi!

The palette is all 0 for 1 bit PCX, attached patch fixes ticket #637 for me.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index b2d433a..e940868 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -224,6 +224,9 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 
     if (nplanes == 1 && bits_per_pixel == 8) {
         pcx_palette(&buf, (uint32_t *) p->data[1], 256);
+    } else if (bits_per_pixel * nplanes == 1) {
+        ((uint32_t *) p->data[1])[0] = 0xFF000000;
+        ((uint32_t *) p->data[1])[1] = 0xFFFFFFFF;
     } else if (bits_per_pixel < 8) {
         const uint8_t *palette = bufstart+16;
         pcx_palette(&palette, (uint32_t *) p->data[1], 16);


More information about the ffmpeg-devel mailing list