summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_fxt1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texcompress_fxt1.c')
-rw-r--r--src/mesa/main/texcompress_fxt1.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 85becb80d2a..149853f7acd 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -105,7 +105,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
dst, dstRowStride);
if (tempImage)
- _mesa_free((void*) tempImage);
+ free((void*) tempImage);
return GL_TRUE;
}
@@ -162,7 +162,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
dst, dstRowStride);
if (tempImage)
- _mesa_free((void*) tempImage);
+ free((void*) tempImage);
return GL_TRUE;
}
@@ -406,7 +406,7 @@ fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv,
} hist[N_TEXELS];
GLint lenh = 0;
- _mesa_memset(hist, 0, sizeof(hist));
+ memset(hist, 0, sizeof(hist));
for (k = 0; k < n; k++) {
GLint l;
@@ -528,6 +528,7 @@ fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv,
#else
GLint best = fxt1_bestcol(vec, nv, input[k], nc, &err);
#endif
+ assert(best >= 0);
/* add in closest color */
for (i = 0; i < nc; i++) {
sum[best][i] += input[k][i];
@@ -1211,7 +1212,7 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps)
if (comps == 3) {
/* make the whole block opaque */
- _mesa_memset(input, -1, sizeof(input));
+ memset(input, -1, sizeof(input));
}
/* 8 texels each line */
@@ -1305,7 +1306,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
if ((width & 7) | (height & 3)) {
GLint newWidth = (width + 7) & ~7;
GLint newHeight = (height + 3) & ~3;
- newSource = _mesa_malloc(comps * newWidth * newHeight * sizeof(GLchan));
+ newSource = malloc(comps * newWidth * newHeight * sizeof(GLchan));
if (!newSource) {
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression");
@@ -1324,7 +1325,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
if (CHAN_TYPE != GL_UNSIGNED_BYTE) {
const GLuint n = width * height * comps;
const GLchan *src = (const GLchan *) source;
- GLubyte *dest = (GLubyte *) _mesa_malloc(n * sizeof(GLubyte));
+ GLubyte *dest = (GLubyte *) malloc(n * sizeof(GLubyte));
GLuint i;
if (!dest) {
GET_CURRENT_CONTEXT(ctx);
@@ -1335,7 +1336,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
dest[i] = CHAN_TO_UBYTE(src[i]);
}
if (newSource != NULL) {
- _mesa_free(newSource);
+ free(newSource);
}
newSource = dest; /* we'll free this buffer before returning */
source = dest; /* the new, GLubyte incoming image */
@@ -1361,7 +1362,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
cleanUp:
if (newSource != NULL) {
- _mesa_free(newSource);
+ free(newSource);
}
}