occt: master 24e4b3c8

Author Committer Branch Timestamp Parent
CharlemagneLasse afokin master 2022-04-13 12:54:30 master 10a19b2a
Affected Issues  0032929: Modeling Algorithms - Crash in PerformIntersectionAtEnd after deletion of surfdata
Changeset 0032929: Modeling Algorithms - Crash in PerformIntersectionAtEnd after deletion of surfdata

When creating a fillet, num is calculated via ChFi3d_IndexOfSurfData. If it
returns just the number of entries in surfdata, it can happen that this
value becomes invalid when handling the case "two faces common to the edge
are found". When both components are on an arc, there will be num removed
from the surfdata.

num would then be larger than the number of entries surfdata. The derived
num1 is therefore also incorrect. The subsequent usage of this
value will either:

* Debug build: cause an out of bounds exception in ChangeValue
  (`SeqFil.ChangeValue(num)`)
* Release build: cause a segfault when retrieving it via index num1
  (`SeqFil(num1)`)

num + num1 must be recalculated after the deletion happens to correctly
calculate the fillet.

Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
mod - src/ChFi3d/ChFi3d_Builder_C1.cxx Diff File
add - tests/bugs/modalg_8/bug32929 Diff File