validate: Do not try to use a NULL iter
authorThibault Saunier <tsaunier@gnome.org>
Tue, 29 Apr 2014 15:16:50 +0000 (17:16 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 2 May 2014 16:30:22 +0000 (18:30 +0200)
validate/gst/validate/gst-validate-pad-monitor.c

index 681c019..f09c577 100644 (file)
@@ -1095,6 +1095,13 @@ gst_validate_pad_monitor_otherpad_clear_pending_fields (GstValidatePadMonitor *
   iter =
       gst_pad_iterate_internal_links (GST_VALIDATE_PAD_MONITOR_GET_PAD
       (monitor));
+
+  if (iter == NULL) {
+    GST_DEBUG_OBJECT (monitor, "No internally linked pad");
+
+    return;
+  }
+
   done = FALSE;
   while (!done) {
     GValue value = { 0, };
@@ -1140,6 +1147,12 @@ gst_validate_pad_monitor_add_expected_newsegment (GstValidatePadMonitor *
   iter =
       gst_pad_iterate_internal_links (GST_VALIDATE_PAD_MONITOR_GET_PAD
       (monitor));
+
+  if (iter == NULL) {
+    GST_DEBUG_OBJECT (monitor, "No internally linked pad");
+    return;
+  }
+
   done = FALSE;
   while (!done) {
     GValue value = { 0, };