asfdemux: Do not try to free const pointer
authorThiago Santos <thiagoss@embedded.ufcg.edu.br>
Fri, 26 Jun 2009 23:52:29 +0000 (20:52 -0300)
committerThiago Santos <thiagoss@embedded.ufcg.edu.br>
Sat, 27 Jun 2009 00:07:59 +0000 (21:07 -0300)
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

index 445cc24b0ffb232bfbdbb4c5ddf9c1d7fb53dda9..3df6f5734672648eb648fabf15c5201cf63502b0 100644 (file)
@@ -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;