aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-01-30 14:33:53 +0100
committerAnton Khirnov <anton@khirnov.net>2013-02-06 10:21:52 +0100
commit39a9fdd00fea6d2e40d4b9ecba38337549603a7d (patch)
tree20729157e6bcdc3df8b6c5ffad190bd2c45abd06 /libavcodec
parent8136f234445862c94d1c081606b2d1e3d44fccf3 (diff)
downloadffmpeg-39a9fdd00fea6d2e40d4b9ecba38337549603a7d.tar.gz
yop: initialize palette to 0
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.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/yop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 3959ada251..fd7f090839 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -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;