summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-03-19 11:06:40 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-03-19 11:06:40 +0100
commitc9538928b6999c70a8f3bda6fa150c61b46e3933 (patch)
tree245bc9ec06e0c6b49a053e126ad07c38022969ec
parentb7b587bce039b9bf849a635bc1bb2144e920a757 (diff)
ffdec: ensure padding is big enough
-rw-r--r--ext/ffmpeg/gstffmpegdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 7d39053..e84e81a 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -1443,8 +1443,8 @@ gst_ffmpegdec_audio_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
memcpy (ffmpegdec->format.audio.gst_layout,
ffmpegdec->format.audio.ffmpeg_layout,
sizeof (GstAudioChannelPosition) * ffmpegdec->format.audio.channels);
- gst_audio_channel_positions_to_valid_order (ffmpegdec->format.audio.
- gst_layout, ffmpegdec->format.audio.channels);
+ gst_audio_channel_positions_to_valid_order (ffmpegdec->format.
+ audio.gst_layout, ffmpegdec->format.audio.channels);
GST_LOG_OBJECT (ffmpegdec, "output caps %" GST_PTR_FORMAT, caps);
@@ -2858,7 +2858,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstObject * parent, GstBuffer * inbuf)
bsize, in_offset, GST_TIME_ARGS (in_timestamp),
GST_TIME_ARGS (in_duration), in_info->idx);
- if (!GST_MEMORY_IS_ZERO_PADDED (map.memory)) {
+ if (!GST_MEMORY_IS_ZERO_PADDED (map.memory)
+ || (map.maxsize - map.size) < FF_INPUT_BUFFER_PADDING_SIZE) {
/* add padding */
if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;