i965: Fix crash when calling glViewport with no surface bound
authorNeil Roberts <neil@linux.intel.com>
Tue, 8 Dec 2015 16:35:57 +0000 (16:35 +0000)
committerNeil Roberts <neil@linux.intel.com>
Wed, 16 Dec 2015 16:39:29 +0000 (16:39 +0000)
commit8c5310da9d1cbf2272f72d3ed4264544456a4683
tree2dd498f0a1780d69c0e3fdda6195475fc3984223
parent4c7c9e4602b6ff72eb2ef41be4ba780d44d37440
i965: Fix crash when calling glViewport with no surface bound

If EGL_KHR_surfaceless_context is used then glViewport can be called
with NULL for the draw and read surfaces. This was previously causing
a crash because the i965 driver tries to use this point to invalidate
the surfaces and it was derferencing the NULL pointer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93257
Cc: Nanley Chery <nanley.g.chery@intel.com>
Cc: "11.1" <mesa-stable@lists.freedesktop.org>
Tested-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/drivers/dri/i965/brw_context.c