summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_blend.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2010-12-11 13:43:44 +0100
committerChristian König <[email protected]>2010-12-11 13:43:44 +0100
commit772b25e1f366edc857e77b8c1ccdc5297d82cc41 (patch)
tree88d38b52e80319dbd4a0c5b5e038d92f1105110a /src/mesa/swrast/s_blend.c
parentab130400cf91ab471e265e58193c95f04c7aeeda (diff)
parentb3d2ec9942303d1d03e28a25b030eb060415abfb (diff)
Merge remote branch 'origin/master' into pipe-video
Conflicts: src/gallium/drivers/r600/r600_pipe.c src/gallium/drivers/r600/r600_texture.c
Diffstat (limited to 'src/mesa/swrast/s_blend.c')
-rw-r--r--src/mesa/swrast/s_blend.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 1a550c445d3..d61baba0f33 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -819,7 +819,16 @@ static void
blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[],
void *src, const void *dst, GLenum chanType)
{
- GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4];
+ GLfloat (*rgbaF)[4], (*destF)[4];
+
+ rgbaF = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+ destF = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+ if (!rgbaF || !destF) {
+ free(rgbaF);
+ free(destF);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "blending");
+ return;
+ }
if (chanType == GL_UNSIGNED_BYTE) {
GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
@@ -883,6 +892,9 @@ blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[],
blend_general_float(ctx, n, mask, (GLfloat (*)[4]) src,
(GLfloat (*)[4]) dst, chanType);
}
+
+ free(rgbaF);
+ free(destF);
}