mesa: Don't crash when destroying contexts created with no visual.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Feb 2017 18:10:30 +0000 (10:10 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 3 Feb 2017 16:55:02 +0000 (08:55 -0800)
commit3f064e9a4076eac01cf7a59d0f30300ef0638aae
tree8abbf628c3d96a2c00d25c86938933c7105f8dda
parentaf303abcdbeac3b90fb760de19bed56cc40cfff4
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 <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/mesa/main/context.c