Index: riff-media.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/riff/riff-media.c,v
retrieving revision 1.58
diff -u -r1.58 riff-media.c
--- riff-media.c	10 Mar 2006 11:09:23 -0000	1.58
+++ riff-media.c	13 Mar 2006 22:44:31 -0000
@@ -558,7 +558,7 @@
 
     if (GST_BUFFER_SIZE (palette) >= (num_colors * 4)) {
       /* palette is always at least 256*4 bytes */
-      copy = gst_buffer_new_and_alloc (MAX (num_colors * 4, 256 * 4));
+      copy = gst_buffer_new_and_alloc (MAX (GST_BUFFER_SIZE (palette), 256 * 4));
       memcpy (GST_BUFFER_DATA (copy), GST_BUFFER_DATA (palette),
           GST_BUFFER_SIZE (palette));
 
