wayland-drm: Check visual for being NULL
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Tue, 31 May 2011 12:20:59 +0000 (14:20 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 31 May 2011 19:13:37 +0000 (15:13 -0400)
src/egl/wayland/wayland-drm/wayland-drm.c

index d68f9c7..6cc442b 100644 (file)
@@ -100,7 +100,7 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
        buffer->buffer.height = height;
        buffer->buffer.visual = visual;
 
-       if (visual->object.interface != &wl_visual_interface) {
+       if (!visual || visual->object.interface != &wl_visual_interface) {
                wl_client_post_error(client, &drm->object,
                                     WL_DRM_ERROR_INVALID_VISUAL,
                                     "invalid visual");