diff options
author | Ian Romanick <[email protected]> | 2004-03-26 02:02:48 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2004-03-26 02:02:48 +0000 |
commit | 3623579e43b4c3a8d2eb7edb6efaa6f178279ec9 (patch) | |
tree | 805742389c1e00372ff151805bbd8a6d87045893 /src/mesa/drivers/dri/r200/r200_screen.c | |
parent | 301e55c6cd27e50a9186f096a974321b6df2c511 (diff) |
Make sure drivers don't dereference a NULL pointer if
__driUtilCreateNewScreen returns NULL.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_screen.c')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_screen.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index 45683d8143b..e356309ae10 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -640,16 +640,16 @@ void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, ddx_version, dri_version, drm_version, frame_buffer, pSAREA, fd, internal_api_version, &r200API); - - - create_context_modes = - (PFNGLXCREATECONTEXTMODES) glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; - *driver_modes = r200FillInModes( dri_priv->bpp, - (dri_priv->bpp == 16) ? 16 : 24, - (dri_priv->bpp == 16) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); + if ( psp != NULL ) { + create_context_modes = (PFNGLXCREATECONTEXTMODES) + glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); + if ( create_context_modes != NULL ) { + RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; + *driver_modes = r200FillInModes( dri_priv->bpp, + (dri_priv->bpp == 16) ? 16 : 24, + (dri_priv->bpp == 16) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); + } } return (void *) psp; |