egl: check for null ptr/name
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 26 Sep 2008 17:17:09 +0000 (11:17 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 27 Sep 2008 02:51:13 +0000 (20:51 -0600)
src/egl/drivers/xdri/egl_xdri.c

index 9ff71588dff3329cb644596092ded6fb565e238b..bb38513e7d07aebeaf7cd5f333360ad066f2d7bc 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 */