audio: Add a missing precondition to gst_audio_format_from_string()
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 28 May 2014 09:23:24 +0000 (10:23 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 28 May 2014 09:34:01 +0000 (11:34 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=730874

gst-libs/gst/audio/audio-format.c

index c7f5d46..5a06850 100644 (file)
@@ -404,6 +404,8 @@ gst_audio_format_from_string (const gchar * format)
 {
   guint i;
 
+  g_return_val_if_fail (format != NULL, GST_AUDIO_FORMAT_UNKNOWN);
+
   for (i = 0; i < G_N_ELEMENTS (formats); i++) {
     if (strcmp (GST_AUDIO_FORMAT_INFO_NAME (&formats[i]), format) == 0)
       return GST_AUDIO_FORMAT_INFO_FORMAT (&formats[i]);