mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
ffmpegdec: Make sure we provide 16 byte aligned data to ffmpeg. Fixes #572863
We simply allocate the memory using ffmpeg's av_malloc which provides us with properly memalign'ed data. This avoids write-outside-of-bounds when sse/altivec code is being used.
This commit is contained in:
parent
df6fb6867e
commit
98167578c4
1 changed files with 6 additions and 2 deletions
|
@ -1794,8 +1794,12 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
|
|||
GST_TIME_ARGS (in_timestamp), GST_TIME_ARGS (in_duration),
|
||||
GST_TIME_ARGS (ffmpegdec->next_ts));
|
||||
|
||||
/* outgoing buffer */
|
||||
*outbuf = gst_buffer_new_and_alloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
|
||||
/* outgoing buffer. We use av_malloc() to have properly aligned memory. */
|
||||
*outbuf = gst_buffer_new ();
|
||||
GST_BUFFER_DATA (*outbuf) = GST_BUFFER_MALLOCDATA (*outbuf) =
|
||||
av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
|
||||
GST_BUFFER_SIZE (*outbuf) = AVCODEC_MAX_AUDIO_FRAME_SIZE;
|
||||
GST_BUFFER_FREE_FUNC (*outbuf) = av_free;
|
||||
|
||||
len = avcodec_decode_audio2 (ffmpegdec->context,
|
||||
(int16_t *) GST_BUFFER_DATA (*outbuf), &have_data, data, size);
|
||||
|
|
Loading…
Reference in a new issue