mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
vulkan/xcb: Don't try to create xcb window with non-xcb display
Non-xcb display does not have a xcb_connection and trying to create xcb window with wild pointer can cause segfault.
This commit is contained in:
parent
338a32b672
commit
94671be428
1 changed files with 9 additions and 1 deletions
|
@ -271,9 +271,17 @@ static gboolean
|
|||
gst_vulkan_window_xcb_open (GstVulkanWindow * window, GError ** error)
|
||||
{
|
||||
GstVulkanWindowXCB *window_xcb = GST_VULKAN_WINDOW_XCB (window);
|
||||
GstVulkanDisplayXCB *display_xcb = (GstVulkanDisplayXCB *) window->display;
|
||||
GstVulkanDisplayXCB *display_xcb;
|
||||
xcb_connection_t *connection;
|
||||
|
||||
if (!GST_IS_VULKAN_DISPLAY_XCB (window->display)) {
|
||||
g_set_error (error, GST_VULKAN_WINDOW_ERROR,
|
||||
GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||
"Cannot create an XCB window from a non-XCB display");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
display_xcb = GST_VULKAN_DISPLAY_XCB (window->display);
|
||||
connection = GST_VULKAN_DISPLAY_XCB_CONNECTION (display_xcb);
|
||||
if (connection == NULL) {
|
||||
g_set_error (error, GST_VULKAN_WINDOW_ERROR,
|
||||
|
|
Loading…
Reference in a new issue