ximagesink: Don't access structures of EMPTY caps
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 21 Mar 2013 12:29:06 +0000 (13:29 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 21 Mar 2013 12:29:06 +0000 (13:29 +0100)
If the intersection between our caps and the filter caps is
empty, just immediately return EMPTY caps instead of trying
to access the (non-existant) structures.

sys/ximage/ximagesink.c

index c036f96..aaf7223 100644 (file)
@@ -1009,6 +1009,11 @@ gst_ximagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
       caps = intersection;
     }
 
+    if (gst_caps_is_empty (caps)) {
+      g_mutex_unlock (&ximagesink->x_lock);
+      return caps;
+    }
+
     if (ximagesink->xwindow && ximagesink->xwindow->width) {
       GstStructure *s0, *s1;