summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@freedesktop.org>2006-04-07 00:05:50 +0000
committerAdam Jackson <ajax@freedesktop.org>2006-04-07 00:05:50 +0000
commitd25ad506f2c2ce28e7d01b8d3f31c1863ef15d63 (patch)
tree23cf95ac89542ca662074b5fa94beb90cc5275ab
parent03593f53e75295ca93bc5cc911094e75c9f38637 (diff)
Coverity #943: Avoid a NULL chase.
-rw-r--r--src/glx/x11/glx_pbuffer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c
index afdf710790..59971585d1 100644
--- a/src/glx/x11/glx_pbuffer.c
+++ b/src/glx/x11/glx_pbuffer.c
@@ -191,20 +191,23 @@ static int
GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value )
{
- __GLXdisplayPrivate *priv = __glXInitialize(dpy);
+ __GLXdisplayPrivate *priv;
xGLXGetDrawableAttributesReply reply;
CARD32 * data;
unsigned int length;
unsigned int i;
unsigned int num_attributes;
+
+ if ( (dpy == NULL) || (drawable == 0) ) {
+ return 0;
+ }
+
+ priv = __glXInitialize(dpy);
GLboolean use_glx_1_3 = ((priv->majorVersion > 1)
|| (priv->minorVersion >= 3));
*value = 0;
- if ( (dpy == NULL) || (drawable == 0) ) {
- return 0;
- }
LockDisplay(dpy);