glx: Prevent potential null pointer deference in driCreateContext.

(cherry picked from commit 4b0b250aae)
This commit is contained in:
Vinson Lee 2009-11-23 01:30:32 -05:00
parent 978b80c8e3
commit 76b3523d75
1 changed files with 3 additions and 1 deletions

View File

@ -250,12 +250,14 @@ driCreateContext(__GLXscreenConfigs * psc,
{ {
__GLXDRIcontextPrivate *pcp, *pcp_shared; __GLXDRIcontextPrivate *pcp, *pcp_shared;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
const __DRIcoreExtension *core = psc->core; const __DRIcoreExtension *core;
__DRIcontext *shared = NULL; __DRIcontext *shared = NULL;
if (!psc || !psc->driScreen) if (!psc || !psc->driScreen)
return NULL; return NULL;
core = psc->core;
if (shareList) { if (shareList) {
pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
shared = pcp_shared->driContext; shared = pcp_shared->driContext;