From 36fa065dc959e61a4472e939f48a5a6abf7dedb3 Mon Sep 17 00:00:00 2001 From: Fabrizio Gennari Date: Tue, 14 Mar 2006 15:13:04 +0000 Subject: [PATCH] gst-libs/gst/riff/riff-media.c: Make sure the buffer we copy into is really always big enough, this time for real (#3... Original commit message from CVS: Patch by: Fabrizio Gennari * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): Make sure the buffer we copy into is really always big enough, this time for real (#333488). --- ChangeLog | 8 ++++++++ gst-libs/gst/riff/riff-media.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 692f1a8..c5d9296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-03-14 Tim-Philipp Müller + Patch by: Fabrizio Gennari + + * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): + Make sure the buffer we copy into is really always big + enough, this time for real (#333488). + +2006-03-14 Tim-Philipp Müller + * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): Add support for 24bpp DIB (#305279). diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index d8ad835..d786d8d 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -577,7 +577,8 @@ gst_riff_create_video_caps (guint32 codec_fcc, 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)); -- 2.7.4