slang: Fix allocation size.
authorMichal Krol <michal@vmware.com>
Tue, 24 Nov 2009 10:22:03 +0000 (11:22 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 24 Nov 2009 10:22:03 +0000 (11:22 +0100)
We don't need 16K+ to store a single pointer.

src/mesa/shader/slang/slang_emit.c

index fe39b46dbb485927216dcba02be33074f8edf9aa..99eb254cee0392257a464eaf96bc899ae95ed442 100644 (file)
@@ -81,8 +81,8 @@ new_subroutine(slang_emit_info *emitInfo, GLuint *id)
 
    emitInfo->Subroutines = (struct gl_program **)
       _mesa_realloc(emitInfo->Subroutines,
-                    n * sizeof(struct gl_program),
-                    (n + 1) * sizeof(struct gl_program));
+                    n * sizeof(struct gl_program *),
+                    (n + 1) * sizeof(struct gl_program *));
    emitInfo->Subroutines[n] = ctx->Driver.NewProgram(ctx, emitInfo->prog->Target, 0);
    emitInfo->Subroutines[n]->Parameters = emitInfo->prog->Parameters;
    emitInfo->NumSubroutines++;