From: Tim-Philipp Müller Date: Mon, 17 Oct 2011 14:41:58 +0000 (+0100) Subject: audiotestsrc: fix crash when setting the wave property before having negotiated a... X-Git-Tag: RELEASE-0.11.2~477 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a586547b0cf6d2852a6fc90ac4a4ebc10604020a;p=platform%2Fupstream%2Fgst-plugins-base.git audiotestsrc: fix crash when setting the wave property before having negotiated a format https://bugzilla.gnome.org/show_bug.cgi?id=661911 --- diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index f6bb81f1f..ba6f255c8 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;