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:
authorCampbell Barton <ideasman42@gmail.com>2021-12-15 15:39:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-12-15 15:40:33 +0300
commit6a885e5d89599d5acec8792bcb6aab49b6c4773c (patch)
tree6ba9783bc22673cf5c09035a6d7b565ab4d9224a
parent3a856f7967659983b4182f8cfc640f6daf3c23cf (diff)
Fix meta-ball bound-box calculation reading past buffer bounds
This broke "test_undo.view3d_multi_mode_select" test in "lib/tests/ui_simulate" and is likely exposed by recent changes to bounding box calculation. The missing check for DL_INDEX4 dates back to code from 2002 which intended to check this but was checking for DL_INDEX3 twice which got removed as part of a cleaned up. This could be hidden from memory checking tools as meta-balls over-allocate vertex arrays.
-rw-r--r--source/blender/blenkernel/intern/displist.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index a8a7b5c5af3..edf043de63f 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -1528,7 +1528,7 @@ void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])
bool doit = false;
LISTBASE_FOREACH (const DispList *, dl, dispbase) {
- const int tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
+ const int tot = (ELEM(dl->type, DL_INDEX3, DL_INDEX4)) ? dl->nr : dl->nr * dl->parts;
for (const int i : IndexRange(tot)) {
minmax_v3v3_v3(min, max, &dl->verts[i * 3]);
}