summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2007-09-06 22:36:12 +0200
committerPatrice Mandin <pmandin@caramail.com>2007-09-06 22:36:12 +0200
commit249ca55555beea76c63a5f5dd09d35aa45efa180 (patch)
tree4589e79279050829554bd07612d63a86e2a25221 /src
parent15a6bf9118937e1e705e64e36fbceafbb3ad70ed (diff)
nouveau: nv10: check NULL pointers
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index 94525ba2a8..b63893d05c 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -253,8 +253,12 @@ static void nv10DepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
GLfloat depth_scale = 16777216.0;
- if (ctx->DrawBuffer->_DepthBuffer->DepthBits == 16) {
- depth_scale = 32768.0;
+ if (ctx->DrawBuffer) {
+ if (ctx->DrawBuffer->_DepthBuffer) {
+ if (ctx->DrawBuffer->_DepthBuffer->DepthBits == 16) {
+ depth_scale = 32768.0;
+ }
+ }
}
BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR, 2);