summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 9a84f04af1..13307fc2c1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -895,7 +895,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
ubyte *buffer;
int i;
- buffer = malloc(width * height * sizeof(ubyte));
+ buffer = _mesa_malloc(width * height * sizeof(ubyte));
if (!buffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)");
return;
@@ -950,7 +950,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
}
- free(buffer);
+ _mesa_free(buffer);
/* unmap the stencil buffer */
screen->transfer_unmap(screen, ptDraw);
@@ -1058,19 +1058,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf);
pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
else {
/* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint));
pipe_get_tile_z(ptRead, 0, 0, width, height, buf);
pipe_put_tile_z(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
screen->tex_transfer_release(screen, &ptRead);