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  <fabrizio dot ge at tiscali dot it>
* 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).
This commit is contained in:
Fabrizio Gennari 2006-03-14 15:13:04 +00:00 committed by Tim-Philipp Müller
parent 442722beba
commit 36fa065dc9
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2006-03-14 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it>
* 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 <tim at centricular dot net>
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):

View file

@ -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));