Fix T45439 crash with subsurf when many materials present.
Silly oversight on the viewport patch
This commit is contained in:
parent
56bf25d219
commit
32c6d92cb0
Notes:
blender-bot
2023-02-14 08:53:22 +01:00
Referenced by issue #45439, Adding subsurf on selected object in this file crashes Blender with Asan (heap buffer overflow).
|
@ -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++;
|
||||
|
|
Loading…
Reference in New Issue