From: nobled Date: Tue, 7 Sep 2010 16:20:15 +0000 (-0400) Subject: dri: Use the right type for the API token X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b8c9fef1128cfeee5e5ba75ba7d645522cc76c2;p=mesa.git dri: Use the right type for the API token Pass mesa_api to CreateContext, and abort early if the requested API isn't recognized. --- diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index a581c6663f2..5f079867739 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;