glupload: Don't throw assertions on invalid allocation query
authorJan Schmidt <jan@centricular.com>
Fri, 7 Jul 2017 04:41:17 +0000 (14:41 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:29 +0000 (19:32 +0000)
basesrc can send an allocation query with no caps, in which
case we should just fail it without throwing assertions.

gst-libs/gst/gl/gstglupload.c

index ddfeaf3..1bdbfb1 100644 (file)
@@ -324,6 +324,8 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
   GstCapsFeatures *features;
 
   gst_query_parse_allocation (query, &caps, NULL);
+  if (caps == NULL)
+    goto invalid_caps;
   features = gst_caps_get_features (caps, 0);
 
   /* Only offer our custom allocator if that type of memory was negotiated. */