egl: added null ptr check
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 16:20:06 +0000 (10:20 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 16:20:06 +0000 (10:20 -0600)
src/egl/main/eglconfig.c

index 794a783..3ef0564 100644 (file)
@@ -340,8 +340,10 @@ _eglChooseConfig(_EGLDriver *drv, EGLDisplay dpy, const EGLint *attrib_list,
    qsort(configList, count, sizeof(_EGLConfig *), _eglCompareConfigs);
 
    /* copy config handles to output array */
-   for (i = 0; i < count; i++) {
-      configs[i] = configList[i]->Handle;
+   if (configs) {
+      for (i = 0; i < count; i++) {
+         configs[i] = configList[i]->Handle;
+      }
    }
 
    free(configList);