[FFmpeg-cvslog] brender_pix: use a grayscale palette as fallback instead of a uninitialized one.
Michael Niedermayer
git at videolan.org
Thu Feb 21 00:28:24 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Feb 21 00:21:47 2013 +0100| [551d8b58ebc03114d4231df92e366ffb7bf7ff62] | committer: Michael Niedermayer
brender_pix: use a grayscale palette as fallback instead of a uninitialized one.
Improves: 3-0-CORPSE.PIX
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=551d8b58ebc03114d4231df92e366ffb7bf7ff62
---
libavcodec/brender_pix.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavcodec/brender_pix.c b/libavcodec/brender_pix.c
index 5245fa0..6c63244 100644
--- a/libavcodec/brender_pix.c
+++ b/libavcodec/brender_pix.c
@@ -193,6 +193,14 @@ static int brpix_decode_frame(AVCodecContext *avctx,
s->frame.palette_has_changed = 1;
chunk_type = bytestream2_get_be32(&gb);
+ } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
+ uint32_t *pal_out = (uint32_t *)s->frame.data[1];
+ int i;
+
+ for (i = 0; i < 256; ++i) {
+ *pal_out++ = (0xFFU << 24) | (i * 0x010101);
+ }
+ s->frame.palette_has_changed = 1;
}
data_len = bytestream2_get_be32(&gb);
More information about the ffmpeg-cvslog
mailing list