validate: Avoid segfault when discovering fails
authorThibault Saunier <tsaunier@gnome.org>
Wed, 2 Apr 2014 17:13:50 +0000 (19:13 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 2 Apr 2014 17:17:24 +0000 (19:17 +0200)
In that case the x->stream_info might not be set

validate/gst/validate/gst-validate-media-info.c

index 4101451..d1e6e5c 100644 (file)
@@ -1148,7 +1148,10 @@ gst_validate_media_info_compare (GstValidateMediaInfo * expected,
       }
   }
 
-  if (expected->stream_info
+  if (extracted->stream_info == NULL || expected->stream_info == NULL) {
+    g_print ("Stream infos could not be retrived, an error occured\n");
+    ret = FALSE;
+  } else if (expected->stream_info
       && !gst_caps_is_equal_fixed (expected->stream_info->caps,
           extracted->stream_info->caps)) {
     gchar *caps1 = gst_caps_to_string (expected->stream_info->caps);