From df6fb6867ed19bfc5f735518452153d5e81efc04 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 6 Mar 2009 12:47:12 +0100 Subject: [PATCH] ffaudioresample: Add padding to output buffer. Fixes #573649 The internal resampling functions seem to require a slightly bigger buffer for output than what we require. Therefore we give it an extra 64bytes (although 16 should have been enough). --- ext/ffmpeg/gstffmpegaudioresample.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegaudioresample.c b/ext/ffmpeg/gstffmpegaudioresample.c index f1d3260340..7900ed4763 100644 --- a/ext/ffmpeg/gstffmpegaudioresample.c +++ b/ext/ffmpeg/gstffmpegaudioresample.c @@ -197,7 +197,9 @@ gst_ffmpegaudioresample_transform_size (GstBaseTransform * trans, return FALSE; conv = gst_util_uint64_scale (size, outrate * outchanns, inrate * inchanns); - *othersize = (guint) conv; + /* Adding padding to the output buffer size, since audio_resample's internal + * methods might write a bit further. */ + *othersize = (guint) conv + 64; GST_DEBUG_OBJECT (trans, "Transformed size from %d to %d", size, *othersize);