summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobled <nobled@dreamwidth.org>2010-09-07 12:20:15 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-07 12:26:33 -0400
commit1b8c9fef1128cfeee5e5ba75ba7d645522cc76c2 (patch)
treec44be4110fe6694573b65e88b2d208cf5d971dd8
parent28c790ab3118ee4c4171120cba2abf2ae3e84805 (diff)
dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early if the requested API isn't recognized.
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index a581c6663f..5f07986773 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -651,6 +651,8 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
case __DRI_API_GLES2:
mesa_api = API_OPENGLES2;
break;
+ default:
+ return NULL;
}
context = malloc(sizeof *context);
@@ -661,7 +663,7 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
context->driDrawablePriv = NULL;
context->loaderPrivate = data;
- if (!(*screen->DriverAPI.CreateContext)(api, &config->modes,
+ if (!(*screen->DriverAPI.CreateContext)(mesa_api, &config->modes,
context, shareCtx) ) {
free(context);
return NULL;