ext/ffmpeg/gstffmpegcodecmap.c: Pad codec data buffer to a size that is a multiple...
authorTim-Philipp Müller <tim@centricular.net>
Thu, 26 Jan 2006 17:18:37 +0000 (17:18 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 26 Jan 2006 17:18:37 +0000 (17:18 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_with_codecid):
Pad codec data buffer to a size that is a multiple of 16, which
ffmpeg apparently needs for optimized/unchecked access to the
data. Fixes crashes with HD h264 video.

ChangeLog
ext/ffmpeg/gstffmpegcodecmap.c

index 962c482..ca7781e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-26  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_with_codecid):
+         Pad codec data buffer to a size that is a multiple of 16, which
+         ffmpeg apparently needs for optimized/unchecked access to the
+         data. Fixes crashes with HD h264 video.
+
 2006-01-23  Edward Hervey  <edward@fluendo.com>
 
        * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
index 9d4162c..7e5e218 100644 (file)
@@ -1284,7 +1284,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
   /* extradata parsing (esds [mpeg4], wma/wmv, msmpeg4v1/2/3, etc.) */
   if ((value = gst_structure_get_value (str, "codec_data"))) {
     buf = GST_BUFFER (gst_value_get_mini_object (value));
-    context->extradata = av_mallocz (GST_BUFFER_SIZE (buf));
+    context->extradata = av_mallocz (GST_ROUND_UP_16 (GST_BUFFER_SIZE (buf)));
     memcpy (context->extradata, GST_BUFFER_DATA (buf),
         GST_BUFFER_SIZE (buf));
     context->extradata_size = GST_BUFFER_SIZE (buf);