From 6f9eebfd2d4e077cf80e9c56d1e874753468af0d Mon Sep 17 00:00:00 2001 From: Jordy Vieira Date: Sat, 9 Jul 2022 17:17:14 -0300 Subject: [PATCH] Fix SIGSEGV (cherry picked from commit 5ec233b0f80030c9416f96b80a16f76055f30d81) --- src/view-backend-exportable-fdo-egl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/view-backend-exportable-fdo-egl.cpp b/src/view-backend-exportable-fdo-egl.cpp index fa0986c..0031222 100644 --- a/src/view-backend-exportable-fdo-egl.cpp +++ b/src/view-backend-exportable-fdo-egl.cpp @@ -265,9 +265,11 @@ class ClientBundleEGL final : public ClientBundle { private: struct wpe_fdo_egl_exported_image* findImage(struct wl_resource* bufferResource) { - if (auto* listener = wl_resource_get_destroy_listener(bufferResource, bufferDestroyListenerCallback)) { - struct wpe_fdo_egl_exported_image* image; - return wl_container_of(listener, image, bufferDestroyListener); + if (bufferResource) { + if (auto* listener = wl_resource_get_destroy_listener(bufferResource, bufferDestroyListenerCallback)) { + struct wpe_fdo_egl_exported_image* image; + return wl_container_of(listener, image, bufferDestroyListener); + } } return nullptr;