From a7d9d448bdf4f5403eaf4effbf1ccbbb0782a476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 25 Jan 2016 20:08:11 +0100 Subject: [PATCH] avaudenc: Use av_malloc() instead of GLib malloc() wrappers for memory freed by ffmpeg It has its own allocator that is not necessarily doing the same as malloc and will then usually crash. E.g. on Windows or when memalign() is available. --- ext/libav/gstavaudenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c index 9a8e69026c..ad8da9089d 100644 --- a/ext/libav/gstavaudenc.c +++ b/ext/libav/gstavaudenc.c @@ -488,12 +488,12 @@ gst_ffmpegaudenc_encode_audio (GstFFMpegAudEnc * ffmpegaudenc, if (info->channels > AV_NUM_DATA_POINTERS) { buffer_info->ext_data_array = frame->extended_data = - g_new (uint8_t *, info->channels); + av_malloc_array (info->channels, sizeof (uint8_t *)); } else { frame->extended_data = frame->data; } - buffer_info->ext_data = frame->extended_data[0] = g_malloc (in_size); + buffer_info->ext_data = frame->extended_data[0] = av_malloc (in_size); frame->linesize[0] = in_size / channels; for (i = 1; i < channels; i++) frame->extended_data[i] =