egl: check for null ptr/name
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 26 Sep 2008 17:17:09 +0000 (11:17 -0600)
committerZack Rusin <zack@tungstengraphics.com>
Thu, 2 Oct 2008 14:19:46 +0000 (10:19 -0400)
src/egl/drivers/xdri/egl_xdri.c

index 83d4b86d98f942a6e6eb573e8b61e6e979886d8c..3b3e312746e9fb3d1a1feb0d2d63faf2405ea139 100644 (file)
@@ -654,7 +654,10 @@ xdri_eglInitialize(_EGLDriver *drv, EGLDisplay dpy,
 
    xdri_drv->Base.Initialized = EGL_TRUE;
 
-   snprintf(name, sizeof(name), "X/DRI:%s", xdri_drv->dri_driver_name);
+   if (xdri_drv->dri_driver_name)
+      snprintf(name, sizeof(name), "X/DRI:%s", xdri_drv->dri_driver_name);
+   else
+      snprintf(name, sizeof(name), "X/DRI");
    xdri_drv->Base.Name = name;
 
    /* we're supporting EGL 1.4 */