[Bf-blender-cvs] [25af6df87de] greasepencil-refactor: GPU: VertexFormat: Fix assert off by one
Clément Foucault
noreply at git.blender.org
Wed Dec 11 13:48:54 CET 2019
Commit: 25af6df87de6627253282e10837f5ba654a941ab
Author: Clément Foucault
Date: Wed Dec 11 14:19:43 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB25af6df87de6627253282e10837f5ba654a941ab
GPU: VertexFormat: Fix assert off by one
===================================================================
M source/blender/gpu/intern/gpu_vertex_format.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_vertex_format.c b/source/blender/gpu/intern/gpu_vertex_format.c
index 6c3ca6046f2..16d8f8f875b 100644
--- a/source/blender/gpu/intern/gpu_vertex_format.c
+++ b/source/blender/gpu/intern/gpu_vertex_format.c
@@ -226,8 +226,8 @@ void GPU_vertformat_multiload_enable(GPUVertFormat *format, int load_count)
VertexFormat_pack(format);
}
- BLI_assert(format->name_len + format->attr_len * (load_count - 1) < GPU_VERT_FORMAT_MAX_NAMES);
- BLI_assert(format->attr_len + format->attr_len * (load_count - 1) < GPU_VERT_ATTR_MAX_LEN);
+ BLI_assert((format->name_len + 1) * load_count < GPU_VERT_FORMAT_MAX_NAMES);
+ BLI_assert(format->attr_len * load_count <= GPU_VERT_ATTR_MAX_LEN);
BLI_assert(format->name_offset * load_count < GPU_VERT_ATTR_NAMES_BUF_LEN);
const GPUVertAttr *attr = format->attrs;
More information about the Bf-blender-cvs
mailing list