diff options
author | Ian Romanick <[email protected]> | 2017-05-24 22:14:44 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2017-06-01 10:09:43 +0200 |
commit | 57b38cc0774f1ca5fd8afe16728dd5d248b61b65 (patch) | |
tree | f7bfe306dc8e93438b2eb16dd74bba6ccb297a6f /src/mesa/drivers/dri/radeon | |
parent | ca8481c41cec6eaf9936b9adc9cf089a8d3bee21 (diff) |
r100,r200: Don't assume glVisual is non-NULL during context creation
Thanks to EGL_MESA_configless_context, the visual pointer can be NULL.
Fixes a segfault (or assertion failure) in piglit's
egl-configless-context test.
Signed-off-by: Ian Romanick <[email protected]>
Cc: [email protected]
Reviewed-by: Kenneth Graunke <[email protected]>
(cherry picked from commit c24881d39c139c451c1c096d6b0a98c8945c902b)
Signed-off-by: Juan A. Suarez Romero <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_common_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index f0c2dfa6ba3..77894353761 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -182,7 +182,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon, radeon->texture_depth = driQueryOptioni (&radeon->optionCache, "texture_depth"); if (radeon->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB) - radeon->texture_depth = ( glVisual->rgbBits > 16 ) ? + radeon->texture_depth = (glVisual == NULL || glVisual->rgbBits > 16) ? DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16; radeon->texture_row_align = 32; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 5e15b46fb32..11afe20c6a0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -165,7 +165,6 @@ r100CreateContext( gl_api api, return false; } - assert(glVisual); assert(driContextPriv); assert(screen); |