diff options
author | marha <marha@users.sourceforge.net> | 2011-06-27 08:55:46 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-06-27 08:55:46 +0200 |
commit | 0feab87a4300a3e204e259d14a0a63e58e4a3c8f (patch) | |
tree | 0ff984b670b1409d8f665be20dfd8f410bdf2473 /mesalib/src/mesa/main/pack.c | |
parent | 97c96ddb6f56be198c2e8bf04ff25bc7b48dd1f2 (diff) | |
download | vcxsrv-0feab87a4300a3e204e259d14a0a63e58e4a3c8f.tar.gz vcxsrv-0feab87a4300a3e204e259d14a0a63e58e4a3c8f.tar.bz2 vcxsrv-0feab87a4300a3e204e259d14a0a63e58e4a3c8f.zip |
xwininfo fontconfig mesa pixman git update 27 June 2011
Diffstat (limited to 'mesalib/src/mesa/main/pack.c')
-rw-r--r-- | mesalib/src/mesa/main/pack.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c index d6470e351..a232a51c3 100644 --- a/mesalib/src/mesa/main/pack.c +++ b/mesalib/src/mesa/main/pack.c @@ -4683,7 +4683,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking ) { - GLfloat *depthTemp, *depthValues; + GLfloat *depthTemp = NULL, *depthValues; GLboolean needClamp = GL_FALSE; /* Look for special cases first. @@ -4729,16 +4729,16 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, /* general case path follows */ - depthTemp = (GLfloat *) malloc(n * sizeof(GLfloat)); - if (!depthTemp) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); - return; - } - if (dstType == GL_FLOAT) { depthValues = (GLfloat *) dest; } else { + depthTemp = (GLfloat *) malloc(n * sizeof(GLfloat)); + if (!depthTemp) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking"); + return; + } + depthValues = depthTemp; } @@ -4782,6 +4782,7 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, } zValues[i] = value & 0xffffff00; } + free(depthTemp); return; } else { |