[Mesa-dev] [PATCH 13/15] glx: Added missing null check in GetDrawableAttribute()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Sun Apr 27 13:05:08 PDT 2014


For GLX_BACK_BUFFER_AGE_EXT query added extra null check.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/glx/glx_pbuffer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 0cd0554..bbfdd65 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -319,6 +319,10 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
    pdraw = GetGLXDRIDrawable(dpy, drawable);
 
    if (attribute == GLX_BACK_BUFFER_AGE_EXT) {
+      if (pdraw == NULL) {
+         return 0;
+      }
+
       struct glx_screen *psc = pdraw->psc;
       struct glx_context *gc = __glXGetCurrentContext();
 
-- 
1.8.1.2



More information about the mesa-dev mailing list