egl: added null ptr checks
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 16:20:47 +0000 (10:20 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 16:20:47 +0000 (10:20 -0600)
src/gallium/winsys/egl_xlib/egl_xlib.c

index 85fc83a4dc60d1b9bfbca47e5129da910fdbe1b8..eeb15e30a92d53b10e6a05a3aa765b73ef36e2b2 100644 (file)
@@ -413,7 +413,10 @@ xlib_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy,
                    (draw_surf ? draw_surf->Framebuffer : NULL),
                    (read_surf ? read_surf->Framebuffer : NULL));
 
-   check_and_update_buffer_size(draw_surf);
+   if (draw_surf)
+      check_and_update_buffer_size(draw_surf);
+   if (read_surf && read_surf != draw_surf)
+      check_and_update_buffer_size(draw_surf);
 
    return EGL_TRUE;
 }