From b0d581eadc8cb21f4997ae03a88b06de6ce53e18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 16 Oct 2012 00:55:56 +0100 Subject: [PATCH] riff: create palette_data buffer correctly gst_buffer_copy_into() will append to any existing memory region, so don't create a buffer and alloc some memory, but just create an empty buffer and let _copy_into() append the memory we want. Fixes the palette being 2048 bytes with the first half being filled with garbage. https://bugzilla.gnome.org/show_bug.cgi?id=686046 --- gst-libs/gst/riff/riff-media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index c64e996..12ff927 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -906,7 +906,7 @@ gst_riff_create_video_caps (guint32 codec_fcc, if (size >= (num_colors * 4)) { /* palette is always at least 256*4 bytes */ - copy = gst_buffer_new_and_alloc (MAX (size, 256 * 4)); + copy = gst_buffer_new (); gst_buffer_copy_into (copy, palette, GST_BUFFER_COPY_MEMORY, 0, size); #if (G_BYTE_ORDER == G_BIG_ENDIAN) -- 2.7.4