Make sure drivers don't dereference a NULL pointer if
__driUtilCreateNewScreen returns NULL.
This commit is contained in:
parent
301e55c6cd
commit
3623579e43
|
@ -439,14 +439,14 @@ void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
|
|||
ddx_version, dri_version, drm_version,
|
||||
frame_buffer, pSAREA, fd,
|
||||
internal_api_version, &i810API);
|
||||
|
||||
|
||||
create_context_modes =
|
||||
(PFNGLXCREATECONTEXTMODES) glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
*driver_modes = i810FillInModes( 16,
|
||||
16, 0,
|
||||
1);
|
||||
if ( psp != NULL ) {
|
||||
create_context_modes = (PFNGLXCREATECONTEXTMODES)
|
||||
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
*driver_modes = i810FillInModes( 16,
|
||||
16, 0,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) psp;
|
||||
|
|
|
@ -538,16 +538,16 @@ void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
|
|||
ddx_version, dri_version, drm_version,
|
||||
frame_buffer, pSAREA, fd,
|
||||
internal_api_version, &mach64API);
|
||||
|
||||
|
||||
create_context_modes =
|
||||
(PFNGLXCREATECONTEXTMODES) glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
|
||||
*driver_modes = mach64FillInModes( dri_priv->cpp * 8,
|
||||
16,
|
||||
0,
|
||||
1);
|
||||
if ( psp != NULL ) {
|
||||
create_context_modes = (PFNGLXCREATECONTEXTMODES)
|
||||
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
|
||||
*driver_modes = mach64FillInModes( dri_priv->cpp * 8,
|
||||
16,
|
||||
0,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) psp;
|
||||
|
|
|
@ -967,16 +967,16 @@ void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
|
|||
ddx_version, dri_version, drm_version,
|
||||
frame_buffer, pSAREA, fd,
|
||||
internal_api_version, &mgaAPI);
|
||||
|
||||
|
||||
create_context_modes =
|
||||
(PFNGLXCREATECONTEXTMODES) glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
|
||||
*driver_modes = mgaFillInModes( dri_priv->cpp * 8,
|
||||
(dri_priv->cpp == 2) ? 16 : 24,
|
||||
(dri_priv->cpp == 2) ? 0 : 8,
|
||||
(dri_priv->backOffset != dri_priv->depthOffset) );
|
||||
if ( psp != NULL ) {
|
||||
create_context_modes = (PFNGLXCREATECONTEXTMODES)
|
||||
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
|
||||
*driver_modes = mgaFillInModes( dri_priv->cpp * 8,
|
||||
(dri_priv->cpp == 2) ? 16 : 24,
|
||||
(dri_priv->cpp == 2) ? 0 : 8,
|
||||
(dri_priv->backOffset != dri_priv->depthOffset) );
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) psp;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -602,16 +602,16 @@ void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
|
|||
ddx_version, dri_version, drm_version,
|
||||
frame_buffer, pSAREA, fd,
|
||||
internal_api_version, &radeonAPI);
|
||||
|
||||
|
||||
create_context_modes =
|
||||
(PFNGLXCREATECONTEXTMODES) glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
|
||||
*driver_modes = radeonFillInModes( 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 = radeonFillInModes( dri_priv->bpp,
|
||||
(dri_priv->bpp == 16) ? 16 : 24,
|
||||
(dri_priv->bpp == 16) ? 0 : 8,
|
||||
(dri_priv->backOffset != dri_priv->depthOffset) );
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) psp;
|
||||
|
|
Loading…
Reference in New Issue