uploadelement: Protect against NULL pointer
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 16 Jul 2015 20:47:05 +0000 (16:47 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:05 +0000 (19:32 +0000)
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 be01143aa3cf0013f4dbaa1d31ebce76625351fb..368c2c93c977678e75bb35b46a98091fc21d069e 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;