glx: Handle a null reply in QueryVersion.

Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
This commit is contained in:
Stéphane Marchesin 2012-05-24 17:58:53 -07:00
parent 1657dec72d
commit 0256edd709
1 changed files with 3 additions and 0 deletions

View File

@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
GLX_MINOR_VERSION),
NULL);
if (!reply)
return GL_FALSE;
if (reply->major_version != GLX_MAJOR_VERSION) {
free(reply);
return GL_FALSE;