Skip to content

Commit

Permalink
Prevent crashing the compositor when the client wants to unset the cu…
Browse files Browse the repository at this point in the history
…rsor.

Change-Id: I40460110e24555aacaef928af32372c32a3291d1
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
  • Loading branch information
Samuel Rødal authored and jorgen committed Sep 22, 2012
1 parent beadb6f commit 9b3c557
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compositor/wayland_wrapper/wlinputdevice.cpp
Expand Up @@ -518,7 +518,7 @@ void InputDevice::pointer_attach(struct wl_client *client,
InputDevice *inputDevice = wayland_cast<InputDevice>(pointer->seat);
wl_buffer *buffer = reinterpret_cast<wl_buffer *>(buffer_resource);

if (wl_buffer_is_shm(buffer)) {
if (buffer && wl_buffer_is_shm(buffer)) {
int stride = wl_shm_buffer_get_stride(buffer);
uint format = wl_shm_buffer_get_format(buffer);
(void) format;
Expand All @@ -530,6 +530,8 @@ void InputDevice::pointer_attach(struct wl_client *client,
delete currentCursor;
currentCursor = img;
}
} else {
inputDevice->m_compositor->waylandCompositor()->changeCursor(QImage(), x, y);
}
}

Expand Down

0 comments on commit 9b3c557

Please sign in to comment.