From 237b2fca7aad9b15f3d8b6928d96cdff790b202a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 19 Feb 2012 20:08:52 -0700 Subject: [PATCH] swrast: remove MAX_WIDTH arrays in s_depth.c --- src/mesa/swrast/s_depth.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index c9038820964..26126a9329f 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; } -- 2.30.2