[Bf-blender-cvs] [32c6d92] master: Fix T45439 crash with subsurf when many materials present.

Antony Riakiotakis noreply at git.blender.org
Wed Jul 15 14:58:28 CEST 2015


Commit: 32c6d92cb0dadd3cf2a1215b7738c009b184596e
Author: Antony Riakiotakis
Date:   Wed Jul 15 14:57:49 2015 +0200
Branches: master
https://developer.blender.org/rB32c6d92cb0dadd3cf2a1215b7738c009b184596e

Fix T45439 crash with subsurf when many materials present.

Silly oversight on the viewport patch

===================================================================

M	source/blender/blenkernel/intern/subsurf_ccg.c

===================================================================

diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index d089660..0b0c011 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -2197,7 +2197,7 @@ static GPUDrawObject *ccgDM_GPUObjectNew(DerivedMesh *dm)
 			gdo->materials[curmat].totloops = matinfo[i].loops;
 			gdo->materials[curmat].mat_nr = i;
 			gdo->materials[curmat].totpolys = matinfo[i].polys;
-			gdo->materials[curmat].polys = MEM_mallocN(sizeof(int) * matinfo[0].polys, "GPUBufferMaterial.polys");
+			gdo->materials[curmat].polys = MEM_mallocN(sizeof(int) * matinfo[i].polys, "GPUBufferMaterial.polys");
 
 			curelement += matinfo[i].elements;
 			curmat++;




More information about the Bf-blender-cvs mailing list