Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-07-01 03:27:41 +0300
committerHans Goudey <h.goudey@me.com>2022-07-01 03:27:41 +0300
commit32e9c9802eb3fb3f85c3dbf791e49ef74a9e2b0a (patch)
tree5bfa0f9abfa2031cd671cd0ea88da22f09390c0e /source/blender/blenkernel/intern/customdata.cc
parent6161ce6e5d5eb3b278ca3c9960e68a0bb3ba87d0 (diff)
Cleanup: Add assert for customdata realloc size
This gives a more clear error than finding the error with the signed to unsigned conversion for size_t.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.cc')
-rw-r--r--source/blender/blenkernel/intern/customdata.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc
index bb5b2ee0836..2cd829a7f0b 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -2329,6 +2329,7 @@ bool CustomData_merge(const CustomData *source,
void CustomData_realloc(CustomData *data, int totelem)
{
+ BLI_assert(totelem > 0);
for (int i = 0; i < data->totlayer; i++) {
CustomDataLayer *layer = &data->layers[i];
const LayerTypeInfo *typeInfo;