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 <victor dot stinner at haypocalc dot com>
* 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.
This commit is contained in:
Sebastian Dröge 2008-01-19 14:53:58 +00:00
parent 505878c022
commit a3b9fddd77
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2008-01-19 Sebastian Dröge <slomo@circular-chaos.org>
Based on a patch by:
Victor STINNER <victor dot stinner at haypocalc dot com>
* 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 <thijsvermeir@gmail.com>
* gst/udp/gstmultiudpsink.c:

View file

@ -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;
}