From 4661b7b1d1e279af46e87a26df89d95dea07474f Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 10 Jun 2016 13:06:49 +0900 Subject: [PATCH] fix memory corruption which was not malloed Change-Id: Icb24bf83d8b3fade1124ad1a6327181c4f8d6055 --- src/media_codec_port_gst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media_codec_port_gst.c b/src/media_codec_port_gst.c index 0d12c63..40e9315 100755 --- a/src/media_codec_port_gst.c +++ b/src/media_codec_port_gst.c @@ -1281,7 +1281,7 @@ int __mc_set_caps_codecdata(mc_gst_core_t *core, GstCaps **caps, GstMCBuffer *bu LOGD("Set caps for codec_data in mime : %s and codec_id (0x%x)", core->mime, core->codec_id); /* Add the codec_data attribute to caps, if we have it */ - codecdata_buffer = gst_buffer_new(); + codecdata_buffer = gst_buffer_new_and_alloc(codecdata_size); gst_buffer_copy_into(codecdata_buffer, buff->buffer, GST_BUFFER_COPY_MEMORY, 0, codecdata_size); gst_buffer_ref(codecdata_buffer); LOGD("setting codec_data from (packet) buf_data used codecdata_size (%d)", codecdata_size); -- 2.7.4