i915: Don't segfault on buffer allocation error
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Wed, 28 May 2008 10:27:52 +0000 (12:27 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Wed, 28 May 2008 10:27:52 +0000 (12:27 +0200)
src/gallium/winsys/egl_drm/intel/intel_egl.c

index 98dbe26376f22c6645033cdaa575176575896a31..809371fdeb1693a367491ab0593ab0747b1e7167 100644 (file)
@@ -479,12 +479,13 @@ drm_show_screen_surface_mesa(_EGLDriver *drv, EGLDisplay dpy,
                DRM_BO_FLAG_NO_EVICT,
                DRM_BO_HINT_DONT_FENCE, &scrn->buffer);
 
-       prettyColors(drm_drv->device->drmFD, scrn->buffer.handle, pitch);
        if (ret) {
                printf("failed to create framebuffer (ret %d)\n", ret);
                return EGL_FALSE;
        }
 
+       prettyColors(drm_drv->device->drmFD, scrn->buffer.handle, pitch);
+
        ret = drmModeAddFB(drm_drv->device->drmFD, mode->Width, mode->Height,
                        32, 32, pitch,
                        scrn->buffer.handle,