st/glx: added null ptr check in Fake_glXCreatePixmap()
authorBrian Paul <brianp@vmware.com>
Wed, 17 Jun 2009 14:33:39 +0000 (08:33 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 17 Jun 2009 14:38:38 +0000 (08:38 -0600)
Fixes segfault in progs/xdemos/glxgears_pixmap.c

src/gallium/state_trackers/glx/xlib/fakeglx.c

index 65e7048188e15d89153a2bcdf89caf8e73a7fb07..6df4c7d69361d8ac136f8bddbe49100df8934d47 100644 (file)
@@ -1817,7 +1817,7 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
    if (!dpy || !config || !pixmap)
       return 0;
 
-   for (attr = attribList; *attr; attr++) {
+   for (attr = attribList; attr && *attr; attr++) {
       switch (*attr) {
       case GLX_TEXTURE_FORMAT_EXT:
          attr++;