summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b266e26c679..f29b56647d0 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);
}