Fix use of nullptr field to calculate array size
Is probably harmless in practice, but the ASAN was generating an error about it: draw_manager_data.cc:187:59: runtime error: member access within null pointer of type 'struct DRWUniformChunk' Pull Request: https://projects.blender.org/blender/blender/pulls/108798
This commit is contained in:
parent
0044c93e84
commit
e682133d2d
|
@ -184,7 +184,7 @@ static void drw_shgroup_uniform_create_ex(DRWShadingGroup *shgroup,
|
|||
/* Happens on first uniform or if chunk is full. */
|
||||
if (!unichunk || unichunk->uniform_used == unichunk->uniform_len) {
|
||||
unichunk = static_cast<DRWUniformChunk *>(BLI_memblock_alloc(DST.vmempool->uniforms));
|
||||
unichunk->uniform_len = ARRAY_SIZE(shgroup->uniforms->uniforms);
|
||||
unichunk->uniform_len = BOUNDED_ARRAY_TYPE_SIZE<decltype(shgroup->uniforms->uniforms)>();
|
||||
unichunk->uniform_used = 0;
|
||||
BLI_LINKS_PREPEND(shgroup->uniforms, unichunk);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue