From: Sebastian Dröge Date: Sat, 19 Jan 2008 14:53:58 +0000 (+0000) Subject: gst/wavparse/gstwavparse.c: Set variable to NULL after freeing it to prevent double... X-Git-Tag: RELEASE-0_10_7~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3b9fddd779edbebc29815f8ff585ea19e83019e;p=platform%2Fupstream%2Fgst-plugins-good.git gst/wavparse/gstwavparse.c: Set variable to NULL after freeing it to prevent double frees or make failures by another... Original commit message from CVS: Based on a patch by: Victor STINNER * gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers): Set variable to NULL after freeing it to prevent double frees or make failures by another use of it afterwards more obvious and fix use of it after the freeing. --- diff --git a/ChangeLog b/ChangeLog index 7f4d8a7..3aa94c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-19 Sebastian Dröge + + Based on a patch by: + Victor STINNER + + * gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers): + Set variable to NULL after freeing it to prevent double frees + or make failures by another use of it afterwards more obvious + and fix use of it after the freeing. + 2008-01-18 Thijs Vermeir * gst/udp/gstmultiudpsink.c: diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index c9e3a52..f8c57b9 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1140,6 +1140,7 @@ gst_wavparse_stream_headers (GstWavParse * wav) wav->vbr = FALSE; g_free (header); + header = NULL; /* do format specific handling */ switch (wav->format) { @@ -1381,8 +1382,7 @@ invalid_blockalign: { GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL), ("Stream claims blockalign = %u, which is more than %u - invalid data", - header->blockalign, - header->channels * (guint) ceil (header->size / 8.0))); + wav->blockalign, wav->channels * (guint) ceil (wav->depth / 8.0))); g_free (codec_name); return GST_FLOW_ERROR; }