st/mesa: fix incorrect version checking code

This commit is contained in:
Brian Paul
2011-03-05 11:08:57 -07:00
parent 8329f4db61
commit ce6f16d382

View File

@@ -684,8 +684,9 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
if (attribs->major > 1 || attribs->minor > 0) {
_mesa_compute_version(st->ctx);
if (st->ctx->VersionMajor < attribs->major ||
st->ctx->VersionMajor < attribs->minor) {
/* is the actual version less than the requested version? */
if (st->ctx->VersionMajor * 10 + st->ctx->VersionMinor <
attribs->major * 10 + attribs->minor) {
st_destroy_context(st);
return NULL;
}