summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-12-05 20:40:48 -0700
committerBrian Paul <brianp@vmware.com>2011-12-08 08:56:31 -0700
commit1614de4045c36ab6ec060e3bd0d1f3394d05b91e (patch)
tree7fca09b2a434ca65e754a4e8e61438a154284091
parentdb247dd7b37e22bf9545d8cb8360e06d68e50912 (diff)
mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--src/mesa/main/image.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index b266e26c67..f29b56647d 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1520,9 +1520,13 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src,
GLenum dstType, GLvoid *dst,
GLuint count, const GLubyte mask[])
{
- GLuint tempBuffer[MAX_WIDTH][4];
+ GLuint *tempBuffer;
const GLboolean useTemp = (src == dst);
+ tempBuffer = malloc(count * MAX_PIXEL_BYTES);
+ if (!tempBuffer)
+ return;
+
ASSERT(srcType != dstType);
switch (srcType) {
@@ -1624,6 +1628,8 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src,
default:
_mesa_problem(NULL, "Invalid datatype in _mesa_convert_colors");
}
+
+ free(tempBuffer);
}