Mesa (10.2): i915: add a missing NULL pointer check
Ian Romanick
idr at kemper.freedesktop.org
Sat May 31 00:33:47 UTC 2014
Module: Mesa
Branch: 10.2
Commit: 15ec4ef0daac770ec6b57e46b3005ba9c48c501c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=15ec4ef0daac770ec6b57e46b3005ba9c48c501c
Author: Lubomir Rintel <lkundrak at v3.sk>
Date: Wed May 28 08:56:12 2014 +0200
i915: add a missing NULL pointer check
mesaVisual can be NULL with configless context since this commit:
commit 551d459af421a2eb937e9e16301bb64da4624f89
Author: Neil Roberts <neil at linux.intel.com>
Date: Fri Mar 7 18:05:47 2014 +0000
Add the EGL_MESA_configless_context extension
...
Previously the i965 and i915 drivers were explicitly creating a zeroed visual
whenever 0 is passed for the EGLConfig.
We attempt to dereference the visual in i915 and now we don't create a
zeroed-out one one it crashes, breaking at least weston in an i915. There's
no point in doing so as it would be zero anyway.
v2: Fixed a typo in commit message. Added some tags.
Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1100967
Cc: "10.2" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 90b5747856dd116e1a7e0fd4a93781400f276c3e)
---
src/mesa/drivers/dri/i915/intel_context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index a6057d3..09fe371 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -507,7 +507,7 @@ intelInitContext(struct intel_context *intel,
_mesa_meta_init(ctx);
- intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
+ intel->hw_stencil = mesaVis && mesaVis->stencilBits && mesaVis->depthBits == 24;
intel->hw_stipple = 1;
intel->RenderIndex = ~0;
More information about the mesa-commit
mailing list