summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Zhelev <rosen.zhelev@arm.com>2021-12-09 13:18:52 +0000
committerMatteo Franchin <matteo.franchin@arm.com>2021-12-13 09:57:53 +0000
commit5bed7d0c9befb626f730392dfd2c9393720f45e1 (patch)
tree8eb45338892593b523838b47a6be4da6050efaea
parentc6a38f53c23e36c73e2d166d8613c7f844fa4ff6 (diff)
downloadvulkan-wsi-layer-5bed7d0c9befb626f730392dfd2c9393720f45e1.tar.gz
vulkan-wsi-layer-5bed7d0c9befb626f730392dfd2c9393720f45e1.tar.bz2
vulkan-wsi-layer-5bed7d0c9befb626f730392dfd2c9393720f45e1.zip
wayland: Fix nulltpr dereference on deprecated swapchains
Fixes a nulltpr dereference when a buffer release event is processed on deprecated swapchains. In such a case some of the swapchain images are invalid and associated resources have been freed. Change-Id: I8f1c66e42e900d63c8c43cb53068a8aee9ea25a9 Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
-rw-r--r--wsi/wayland/swapchain.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/wsi/wayland/swapchain.cpp b/wsi/wayland/swapchain.cpp
index 2f32ed3..2704dc5 100644
--- a/wsi/wayland/swapchain.cpp
+++ b/wsi/wayland/swapchain.cpp
@@ -144,7 +144,7 @@ void swapchain::release_buffer(struct wl_buffer *wayl_buffer)
for (i = 0; i < m_swapchain_images.size(); i++)
{
auto data = reinterpret_cast<wayland_image_data *>(m_swapchain_images[i].data);
- if (data->buffer == wayl_buffer)
+ if (data && data->buffer == wayl_buffer)
{
unpresent_image(i);
break;