From 6e2a117eb2d48e408619a0a4f8c4fc08a978f4e7 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 26 Jun 2009 20:52:29 -0300 Subject: [PATCH] asfdemux: Do not try to free const pointer In gst_asf_demux_chain_headers, when 'goto wrong_type' was called asfdemux tried to free a const pointer that had been cast to a normal pointer variable. --- gst/asfdemux/gstasfdemux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 445cc24..3df6f57 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -744,13 +744,14 @@ gst_asf_demux_chain_headers (GstASFDemux * demux) GstFlowReturn flow; AsfObject obj; guint8 *header_data, *data = NULL; + const guint8 *cdata = NULL; guint64 header_size; - data = (guint8 *) gst_adapter_peek (demux->adapter, ASF_OBJECT_HEADER_SIZE); - if (data == NULL) + cdata = (guint8 *) gst_adapter_peek (demux->adapter, ASF_OBJECT_HEADER_SIZE); + if (cdata == NULL) goto need_more_data; - asf_demux_peek_object (demux, data, ASF_OBJECT_HEADER_SIZE, &obj); + asf_demux_peek_object (demux, cdata, ASF_OBJECT_HEADER_SIZE, &obj); if (obj.id != ASF_OBJ_HEADER) goto wrong_type; -- 2.7.4