uploadelement: Protect against NULL pointer
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 16 Jul 2015 20:47:05 +0000 (16:47 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 16 Jul 2015 21:05:36 +0000 (17:05 -0400)
I notice that if you stop the pipeline during a renegotiation
the upload may be NULL while an allocation query is being run.
In that scenario, returning FALSE to the allocation query is the
best thing.

ext/gl/gstgluploadelement.c

index be01143..368c2c9 100644 (file)
@@ -145,6 +145,9 @@ _gst_gl_upload_element_propose_allocation (GstBaseTransform * bt,
 {
   GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);
 
+  if (!upload->upload)
+    return FALSE;
+
   gst_gl_upload_propose_allocation (upload->upload, decide_query, query);
 
   return TRUE;