summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-02-02 10:10:30 -0800
committerKenneth Graunke <[email protected]>2017-02-03 08:55:02 -0800
commit3f064e9a4076eac01cf7a59d0f30300ef0638aae (patch)
tree8abbf628c3d96a2c00d25c86938933c7105f8dda /src/mesa/main/context.c
parentaf303abcdbeac3b90fb760de19bed56cc40cfff4 (diff)
mesa: Don't crash when destroying contexts created with no visual.
dEQP-EGL.functional.create_context.no_config tries to create a context with no config, then immediately destroys it. The drawbuffer is never set up, so we can't dereference it asking if it's double buffered, or we'll crash on a null pointer dereference. Just bail early. Applications using EGL_KHR_no_config_context could hit this. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 7ecd241e6eb..76763489b9f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1550,7 +1550,7 @@ _mesa_check_init_viewport(struct gl_context *ctx, GLuint width, GLuint height)
static void
handle_first_current(struct gl_context *ctx)
{
- if (ctx->Version == 0) {
+ if (ctx->Version == 0 || !ctx->DrawBuffer) {
/* probably in the process of tearing down the context */
return;
}