libweston/noop-renderer: Check shm_buffer for NULL

Copy the check from the pixman renderer.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/953
Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
(cherry picked from commit 0e451e8dc3)
This commit is contained in:
Jan Alexander Steffens (heftig) 2024-09-14 06:35:09 +02:00 committed by Marius Vlad
parent 60981998b2
commit 32f5596178

View File

@ -94,6 +94,12 @@ noop_renderer_attach(struct weston_paint_node *pnode)
}
shm_buffer = buffer->shm_buffer;
/* This can happen if a SHM wl_buffer gets destroyed before we attach,
* because wayland-server just nukes the wl_shm_buffer from underneath
* us. */
if (!shm_buffer)
return;
data = wl_shm_buffer_get_data(shm_buffer);
stride = buffer->stride;
height = buffer->height;