summaryrefslogtreecommitdiffstats
path: root/ext/esd
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2004-11-01 11:45:26 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2004-11-01 11:45:26 +0000
commitcda239c8b425c1a4530372d4315c8149d213add4 (patch)
tree2a84e1b5a33fe2aed61818ad85fc5704b1dda89f /ext/esd
parentea8e39aa433d0e956dc6114d69ac950f0343b02d (diff)
added two api precondition guards use g_strdup with getenv to fix crash when using ENVVAR
Original commit message from CVS: added two api precondition guards use g_strdup with getenv to fix crash when using ENVVAR
Diffstat (limited to 'ext/esd')
-rw-r--r--ext/esd/esdsink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c
index c9294424..73a32487 100644
--- a/ext/esd/esdsink.c
+++ b/ext/esd/esdsink.c
@@ -178,7 +178,7 @@ gst_esdsink_init (GTypeInstance * instance, gpointer g_class)
esdsink->channels = 2;
esdsink->frequency = 44100;
esdsink->bytes_per_sample = esdsink->channels * (esdsink->depth / 8);
- esdsink->host = getenv ("ESPEAKER");
+ esdsink->host = g_strdup (getenv ("ESPEAKER"));
esdsink->provided_clock =
gst_audio_clock_new ("esdclock", gst_esdsink_get_time, esdsink);
gst_object_set_parent (GST_OBJECT (esdsink->provided_clock),
@@ -205,6 +205,9 @@ gst_esdsink_link (GstPad * pad, const GstCaps * caps)
GstEsdsink *esdsink;
GstStructure *structure;
+ g_return_val_if_fail (caps != NULL, GST_PAD_LINK_REFUSED);
+ g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED);
+
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
structure = gst_caps_get_structure (caps, 0);