summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrianp <brianp>2002-10-10 14:12:40 +0000
committerbrianp <brianp>2002-10-10 14:12:40 +0000
commit2cf5135e9dbd30a6a0b4ea1eddaf632dd4ebd33b (patch)
tree5b8c11c0c9a43ca9e4b9c9f7db209885236be5bc
parent0df018612b15c18f189c3766b2c654922511b5db (diff)
check texImage->IsClientData before freeing memory
-rw-r--r--xc/extras/Mesa/src/teximage.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c
index ce750512d..176edb876 100644
--- a/xc/extras/Mesa/src/teximage.c
+++ b/xc/extras/Mesa/src/teximage.c
@@ -1536,11 +1536,11 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
border, internalFormat);
@@ -1663,11 +1663,11 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
postConvWidth, postConvHeight,
@@ -1788,10 +1788,10 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
border, internalFormat);
@@ -2057,11 +2057,11 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
@@ -2121,11 +2121,11 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
@@ -2308,10 +2308,10 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
border, internalFormat);
@@ -2409,10 +2409,10 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
border, internalFormat);
@@ -2507,10 +2507,10 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
border, internalFormat);