summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_statevars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/prog_statevars.c')
-rw-r--r--src/mesa/program/prog_statevars.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
index f1786e5ba42..82ee5d4cbd4 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -375,7 +375,9 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
case STATE_LOCAL:
if (!ctx->FragmentProgram.Current->LocalParams) {
ctx->FragmentProgram.Current->LocalParams =
- calloc(MAX_PROGRAM_LOCAL_PARAMS, sizeof(float[4]));
+ rzalloc_array_size(ctx->FragmentProgram.Current,
+ sizeof(float[4]),
+ MAX_PROGRAM_LOCAL_PARAMS);
if (!ctx->FragmentProgram.Current->LocalParams)
return;
}
@@ -401,7 +403,9 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
case STATE_LOCAL:
if (!ctx->VertexProgram.Current->LocalParams) {
ctx->VertexProgram.Current->LocalParams =
- calloc(MAX_PROGRAM_LOCAL_PARAMS, sizeof(float[4]));
+ rzalloc_array_size(ctx->VertexProgram.Current,
+ sizeof(float[4]),
+ MAX_PROGRAM_LOCAL_PARAMS);
if (!ctx->VertexProgram.Current->LocalParams)
return;
}