From a586547b0cf6d2852a6fc90ac4a4ebc10604020a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 17 Oct 2011 15:41:58 +0100 Subject: [PATCH] audiotestsrc: fix crash when setting the wave property before having negotiated a format https://bugzilla.gnome.org/show_bug.cgi?id=661911 --- gst/audiotestsrc/gstaudiotestsrc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index f6bb81f1f8..ba6f255c83 100644 --- a/gst/audiotestsrc/gstaudiotestsrc.c +++ b/gst/audiotestsrc/gstaudiotestsrc.c @@ -878,13 +878,19 @@ static const ProcessFunc violet_noise_funcs[] = { /* * gst_audio_test_src_change_wave: - * Assign function pointer of wave genrator. + * Assign function pointer of wave generator. */ static void gst_audio_test_src_change_wave (GstAudioTestSrc * src) { gint idx; + /* not negotiated yet? */ + if (src->info.finfo == NULL) { + src->process = NULL; + return; + } + switch (GST_AUDIO_FORMAT_INFO_FORMAT (src->info.finfo)) { case GST_AUDIO_FORMAT_S16: idx = 0;