aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-01 13:22:08 +0200
committermarha <marha@users.sourceforge.net>2013-08-01 13:22:08 +0200
commit0659c77949b38440a2a9ba67e1ee9cacef1f3a7f (patch)
tree891077ab7001a45e0e37ff2e554db0c56671acdc /mesalib/src/mesa/main/mipmap.c
parent4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a (diff)
downloadvcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.tar.gz
vcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.tar.bz2
vcxsrv-0659c77949b38440a2a9ba67e1ee9cacef1f3a7f.zip
libX11 mesa xserver xkeyboard-config git update 1 aug 2013
xserver commit b6e5c4669e0db391966deb397e8c975ec7f0124d xkeyboard-config commit abaf14335dc6504e59d91e77babc8e034df5beb7 libX11 commit 44f84223f5e2dd46883fcbd352af2798bfa9aeb6 mesa commit 3eef7fec677f40eef1674e44e7ebd836bc7f8612
Diffstat (limited to 'mesalib/src/mesa/main/mipmap.c')
-rw-r--r--mesalib/src/mesa/main/mipmap.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index 583963232..180f89116 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -2024,7 +2024,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
GLubyte *temp_src = NULL, *temp_dst = NULL;
GLenum temp_datatype;
GLenum temp_base_format;
- GLubyte **temp_src_slices, **temp_dst_slices;
+ GLubyte **temp_src_slices = NULL, **temp_dst_slices = NULL;
/* only two types of compressed textures at this time */
assert(texObj->Target == GL_TEXTURE_2D ||
@@ -2063,11 +2063,8 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
temp_dst_slices = malloc(srcImage->Depth * sizeof(GLubyte *));
if (!temp_src || !temp_src_slices || !temp_dst_slices) {
- free(temp_src);
- free(temp_src_slices);
- free(temp_dst_slices);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
- return;
+ goto end;
}
/* decompress base image to the temporary src buffer */
@@ -2119,7 +2116,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
temp_dst = malloc(temp_dst_img_stride * dstDepth);
if (!temp_dst) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps");
- break;
+ goto end;
}
}
@@ -2127,8 +2124,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
if (!dstImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- free(temp_dst);
- return;
+ goto end;
}
/* for 2D arrays, setup array[depth] of slice pointers */
@@ -2153,8 +2149,8 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
dstWidth, dstHeight, dstDepth,
border, srcImage->InternalFormat,
srcImage->TexFormat)) {
- free(temp_dst);
- return;
+ /* all done */
+ goto end;
}
/* The image space was allocated above so use glTexSubImage now */
@@ -2173,6 +2169,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
}
} /* loop over mipmap levels */
+end:
free(temp_src);
free(temp_dst);
free(temp_src_slices);