ext/ffmpeg/gstffmpegcodecmap.c: Pad codec data buffer to a size that is a multiple of 16, which ffmpeg apparently nee...

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.
This commit is contained in:
Tim-Philipp Müller 2006-01-26 17:18:37 +00:00
parent e72a376411
commit 1df8496ffa
2 changed files with 8 additions and 1 deletions

View file

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

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