kmssink: Ensure we have an allocator before importing
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 8 Nov 2019 22:48:40 +0000 (17:48 -0500)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 11 Nov 2019 22:20:28 +0000 (22:20 +0000)
This fixes cases where the kms allocator API was called with a null
pointer.

sys/kms/gstkmssink.c

index b5815a9c9126f75cda9382c52488e91ca7b7af17..23718e9c5087714ef047cc71a542b573122079fa 100644 (file)
@@ -1403,6 +1403,8 @@ gst_kms_sink_import_dmabuf (GstKMSSink * self, GstBuffer * inbuf,
       return FALSE;
   }
 
+  ensure_kms_allocator (self);
+
   kmsmem = (GstKMSMemory *) gst_kms_allocator_get_cached (mems[0]);
   if (kmsmem) {
     GST_LOG_OBJECT (self, "found KMS mem %p in DMABuf mem %p with fb id = %d",