From: Kenneth Graunke Date: Thu, 17 Jun 2010 22:37:26 +0000 (-0700) Subject: Fix crash when running glsl on a signle fragment shader. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c186b3fbe0864caa12e3c3ab8136efd3ca0832a7;p=mesa.git Fix crash when running glsl on a signle fragment shader. --- 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++) {