wayland-shm: Check visual for being NULL

This commit is contained in:
Benjamin Franzke 2011-05-31 11:18:06 +02:00
parent eff7fc0d99
commit b06e891e4c

View file

@ -119,7 +119,7 @@ shm_create_buffer(struct wl_client *client, struct wl_shm *shm,
struct wl_shm_buffer *buffer;
void *data;
if (visual->object.interface != &wl_visual_interface) {
if (!visual || visual->object.interface != &wl_visual_interface) {
wl_client_post_error(client, &shm->object,
WL_SHM_ERROR_INVALID_VISUAL,
"invalid visual");