aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/pack.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-06-27 08:58:51 +0200
committermarha <marha@users.sourceforge.net>2011-06-27 08:58:51 +0200
commit83cb62fe8002927ba95861a4fd21cc44c48bfcf7 (patch)
treef90eaf2bf24e10662389e32a6877c4c95e18229d /mesalib/src/mesa/main/pack.c
parente4b391377808d3a264dacdac7db76add26dee26c (diff)
parent0feab87a4300a3e204e259d14a0a63e58e4a3c8f (diff)
downloadvcxsrv-83cb62fe8002927ba95861a4fd21cc44c48bfcf7.tar.gz
vcxsrv-83cb62fe8002927ba95861a4fd21cc44c48bfcf7.tar.bz2
vcxsrv-83cb62fe8002927ba95861a4fd21cc44c48bfcf7.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/configure.ac apps/xwininfo/xwininfo.c fontconfig/src/fcmatch.c mesalib/include/GL/internal/dri_interface.h mesalib/src/glsl/main.cpp mesalib/src/mesa/main/pack.c mesalib/src/mesa/main/renderbuffer.c mesalib/src/mesa/main/renderbuffer.h mesalib/src/mesa/main/teximage.c mesalib/src/mesa/state_tracker/st_cb_texture.c mesalib/src/mesa/state_tracker/st_draw.c mesalib/src/mesa/state_tracker/st_format.c pixman/configure.ac pixman/pixman/pixman-arm-neon-asm.S pixman/test/blitters-test.c
Diffstat (limited to 'mesalib/src/mesa/main/pack.c')
-rw-r--r--mesalib/src/mesa/main/pack.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c
index fcf0f9f53..215bc7ba7 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 {