From e63a3a7f310b8e8b45b24d75ade8084c246c6b7b Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 6 Jan 2022 22:00:11 +0900 Subject: [PATCH] d3d11compositor: Don't try to read empty buffer The queued buffer may not be readable buffer in case that upstream sends GAP event or so. Part-of: --- .../gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp index 0c70873c2b..aa319eec8e 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp @@ -2429,6 +2429,12 @@ gst_d3d11_compositor_check_device_update (GstElement * agg, if (!buf) return TRUE; + /* Ignore gap buffer */ + if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP) || + gst_buffer_get_size (buf) == 0) { + return TRUE; + } + mem = gst_buffer_peek_memory (buf, 0); /* FIXME: we should be able to accept non-d3d11 memory later once * we remove intermediate elements (d3d11upload and d3d11colorconvert)