From b632b206e122f154b23a04c217d2fbb2927a95e6 Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Wed, 19 Aug 2015 08:37:46 +0900 Subject: [PATCH] tools: discoverer: When info is NULL just print error and return In case discover_uri returns NULL info, passing the info to discoverer APIs result in critical assertion errors. Hence instead of passing NULL info along, print the error and return. https://bugzilla.gnome.org/show_bug.cgi?id=753701 --- tools/gst-discoverer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c index 2c088e56de..16468aeee4 100644 --- a/tools/gst-discoverer.c +++ b/tools/gst-discoverer.c @@ -381,9 +381,16 @@ print_properties (GstDiscovererInfo * info, gint tab) static void print_info (GstDiscovererInfo * info, GError * err) { - GstDiscovererResult result = gst_discoverer_info_get_result (info); + GstDiscovererResult result; GstDiscovererStreamInfo *sinfo; + if (!info) { + g_print ("Could not discover URI\n"); + g_print (" %s\n", err->message); + return; + } + + result = gst_discoverer_info_get_result (info); g_print ("Done discovering %s\n", gst_discoverer_info_get_uri (info)); switch (result) { case GST_DISCOVERER_OK: