wayland-drm: Check visual for being NULL

This commit is contained in:
Benjamin Franzke 2011-05-31 14:20:59 +02:00 committed by Kristian Høgsberg
parent fc5aec9342
commit 089aa313b4
1 changed files with 1 additions and 1 deletions

View 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");