From c186b3fbe0864caa12e3c3ab8136efd3ca0832a7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 17 Jun 2010 15:37:26 -0700 Subject: [PATCH] Fix crash when running glsl on a signle fragment shader. --- linker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linker.cpp b/linker.cpp index ca0cacdfb72..0a1afcf0345 100644 --- a/linker.cpp +++ b/linker.cpp @@ -185,7 +185,7 @@ link_shaders(struct glsl_program *prog) unsigned num_frag_shaders = 0; vert_shader_list = (struct glsl_shader **) - malloc(sizeof(struct glsl_shader *) * 2 * prog->NumShaders); + calloc(2 * prog->NumShaders, sizeof(struct glsl_shader *)); frag_shader_list = &vert_shader_list[prog->NumShaders]; for (unsigned i = 0; i < prog->NumShaders; i++) { -- 2.30.2