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>
This commit is contained in:
Jan Alexander Steffens (heftig) 2024-09-14 06:35:09 +02:00
parent 2e51def212
commit 0e451e8dc3
No known key found for this signature in database
GPG Key ID: B8AC08600F108CDF
1 changed files with 6 additions and 0 deletions

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;