audiotestsrc: fix crash when setting the wave property before having negotiated a...
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 17 Oct 2011 14:41:58 +0000 (15:41 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 17 Oct 2011 14:47:31 +0000 (15:47 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=661911

gst/audiotestsrc/gstaudiotestsrc.c

index f6bb81f1f85c81e218d088fbd659477e2da97385..ba6f255c836146df768aee53aab21107a646ee9a 100644 (file)
@@ -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;