[Mesa-dev] [PATCH 07/19] st_glsl_to_tgsi: use calloc the way it's meant to be used

Nicolai Hähnle nhaehnle at gmail.com
Tue Aug 9 10:36:36 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f2663bc..f3da77d 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6036,21 +6036,21 @@ st_translate_program(
    t->inputMapping = inputMapping;
    t->outputMapping = outputMapping;
    t->ureg = ureg;
 
    /*
     * Declare temporary arrays.
     */
    t->num_temp_arrays = program->num_temp_arrays;
    if (t->num_temp_arrays) {
       t->temp_arrays = (struct ureg_dst*)
-                       calloc(1, sizeof(t->temp_arrays[0]) * t->num_temp_arrays);
+                       calloc(sizeof(t->temp_arrays[0]), t->num_temp_arrays);
       for (i = 0; i < t->num_temp_arrays; ++i)
          t->temp_arrays[i] = ureg_DECL_array_temporary(
             t->ureg, program->temp_arrays[i].size,
             program->temp_arrays[i].usagemask, TRUE);
    }
 
    /*
     * Declare input attributes.
     */
    switch (procType) {
-- 
2.7.4



More information about the mesa-dev mailing list