From e6b112c25e12e7cceabfbf0e0ab5ee48d84649d1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 5 Apr 2004 17:47:30 +0000 Subject: [PATCH] ext/esd/esdmon.c: fix nonterminated vararg and memleak Original commit message from CVS: * ext/esd/esdmon.c: (gst_esdmon_get): fix nonterminated vararg and memleak --- ChangeLog | 5 +++++ ext/esd/esdmon.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ed1473..b4ffddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-04-05 Benjamin Otte + * ext/esd/esdmon.c: (gst_esdmon_get): + fix nonterminated vararg and memleak + +2004-04-05 Benjamin Otte + * ext/ladspa/gstladspa.c: (gst_ladspa_class_init), (gst_ladspa_init), (gst_ladspa_force_src_caps), (gst_ladspa_set_property), (gst_ladspa_get_property), diff --git a/ext/esd/esdmon.c b/ext/esd/esdmon.c index d06af75..e202a3e 100644 --- a/ext/esd/esdmon.c +++ b/ext/esd/esdmon.c @@ -245,20 +245,22 @@ gst_esdmon_get (GstPad * pad) return NULL; } if (!GST_PAD_CAPS (pad)) { - gint sign = (esdmon->depth == 8 ? FALSE : TRUE); + GstCaps *caps = gst_caps_new_simple ("audio/x-raw-int", + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "signed", G_TYPE_BOOLEAN, esdmon->depth == 8 ? FALSE : TRUE, + "width", G_TYPE_INT, esdmon->depth, + "depth", G_TYPE_INT, esdmon->depth, + "rate", G_TYPE_INT, esdmon->frequency, + "channels", G_TYPE_INT, esdmon->channels, + NULL); /* set caps on src pad */ - if (gst_pad_set_explicit_caps (esdmon->srcpad, - gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "signed", G_TYPE_BOOLEAN, sign, - "width", G_TYPE_INT, esdmon->depth, - "depth", G_TYPE_INT, esdmon->depth, - "rate", G_TYPE_INT, esdmon->frequency, - "channels", G_TYPE_INT, esdmon->channels)) <= 0) { + if (gst_pad_set_explicit_caps (esdmon->srcpad, caps) <= 0) { GST_ELEMENT_ERROR (esdmon, CORE, NEGOTIATION, (NULL), (NULL)); + gst_caps_free (caps); return NULL; } + gst_caps_free (caps); } GST_BUFFER_SIZE (buf) = readbytes; -- 2.7.4