]> git.sesse.net Git - ffmpeg/commitdiff
yop: initialize palette to 0
authorAnton Khirnov <anton@khirnov.net>
Wed, 30 Jan 2013 13:33:53 +0000 (14:33 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 6 Feb 2013 09:21:52 +0000 (10:21 +0100)
The FATE sample contains some pixels with value 0, but the palette
stored in the file contains only values from 16 up. Because the default
and cmdutils get_buffer() initialize the data to 0x80, they appear as
gray dots.
After this commit they change to black dots, which is probably still
incorrect but less visible and doesn't rely on get_buffer() initializing
the data.

libavcodec/yop.c
tests/ref/fate/yop

index 3959ada2513e13097ac490d0eaeaa4f666bf5307..fd7f090839dc72fca8a507b985fb9125afff1c35 100644 (file)
@@ -206,6 +206,9 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return ret;
     }
 
+    if (!avctx->frame_number)
+        memset(s->frame.data[1], 0, AVPALETTE_SIZE);
+
     s->dstbuf     = s->frame.data[0];
     s->dstptr     = s->frame.data[0];
     s->srcptr     = avpkt->data + 4;
index 57f565d5f82cfb29dc81d11fb99ab9588516b54d..1a5666069e87ff16cacfc24f53e003006f9b161d 100644 (file)
@@ -1,7 +1,7 @@
 #tb 0: 1/12
 0,          0,          0,        1,   302760, 0x78939253
 0,          1,          1,        1,   302760, 0x534f5253
-0,          2,          2,        1,   302760, 0xe991aa82
-0,          3,          3,        1,   302760, 0xc34b20bd
-0,          4,          4,        1,   302760, 0x461d29a1
+0,          2,          2,        1,   302760, 0x25eaa782
+0,          3,          3,        1,   302760, 0x60861c3d
+0,          4,          4,        1,   302760, 0x43552521
 0,          5,          5,        1,   302760, 0x45abca02