st_glsl_to_tgsi: use calloc the way it's meant to be used
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 8 Aug 2016 18:41:04 +0000 (20:41 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 17 Aug 2016 10:11:22 +0000 (12:11 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 3e5b322b9d108f13da02bf2131b74e3196e807b7..5a9cadcdb2e4cf0694c9750e184d73c427fe89c4 100644 (file)
@@ -6038,7 +6038,7 @@ st_translate_program(
    t->num_temp_arrays = program->next_array;
    if (t->num_temp_arrays)
       t->arrays = (struct ureg_dst*)
-                  calloc(1, sizeof(t->arrays[0]) * t->num_temp_arrays);
+                  calloc(t->num_temp_arrays, sizeof(t->arrays[0]));
 
    /*
     * Declare input attributes.