summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-02-19 20:08:52 -0700
committerBrian Paul <brianp@vmware.com>2012-02-24 08:03:03 -0700
commit237b2fca7aad9b15f3d8b6928d96cdff790b202a (patch)
treea0b68a10b24919f7ab30b8470ae8ddd7b9b8371c /src
parent837b55517ecc1964205e1eb10578b146529abd0b (diff)
downloadexternal_mesa3d-237b2fca7aad9b15f3d8b6928d96cdff790b202a.zip
external_mesa3d-237b2fca7aad9b15f3d8b6928d96cdff790b202a.tar.gz
external_mesa3d-237b2fca7aad9b15f3d8b6928d96cdff790b202a.tar.bz2
swrast: remove MAX_WIDTH arrays in s_depth.c
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_depth.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index c903882..26126a9 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -419,9 +419,15 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
const GLuint count = span->end;
GLuint i;
GLboolean anyPass = GL_FALSE;
- GLuint zBufferTemp[MAX_WIDTH];
+ GLuint *zBufferTemp;
const GLuint *zBufferVals;
+ zBufferTemp = (GLuint *) malloc(count * sizeof(GLuint));
+ if (!zBufferTemp) {
+ /* don't generate a stream of OUT_OF_MEMORY errors here */
+ return GL_FALSE;
+ }
+
if (span->arrayMask & SPAN_XY)
zStart = NULL;
else
@@ -453,6 +459,8 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
}
}
+ free(zBufferTemp);
+
return anyPass;
}