]> OCCT Git - occt.git/commit
0033187: Modeling Algorithms - Crash in postprocessing of imported shape CR30459
authoratereshi <andrey.tereshin@opencascade.com>
Wed, 26 Oct 2022 13:59:54 +0000 (16:59 +0300)
committeratereshi <andrey.tereshin@opencascade.com>
Thu, 24 Nov 2022 08:14:12 +0000 (11:14 +0300)
commitea0257005073858cd8153400a68b088e1ad51ba1
treed67c20e01d61f5b78e544b10643f242f100dfbbf
parenteeba62cbd33d002cc92317e81d241903787369c8
0033187: Modeling Algorithms - Crash in postprocessing of imported shape

Problem: Desynchronization of behaviors of GeomAdaptor_Curve::NbIntervals and
 GeomAdaptor_Curve::Intervals functions. First calculates number of intervals, then
 array is created and second fills the array. In some cases the size of array
 is less than need for filling.

Change:
1. Added function BSplCLib::Intervals that calculates number of interval and fills
 the array with its (if needed).
2. Simplified the algorithm of intervals calculation.
3. GeomAdaptor_Curve::NbIntervals/Intervals and Geom2dAdaptor_Curve::NbIntervals/Intervals
 use BSplCLib::Intervals.
4. When creating an adapter for the base curve, the boundaries of the adapter for the offset curve are applied.
5. Test for problem shape was created: bugs modalg_8 bug33187.

Result: The new approach eliminates the problem of writing outside the array bounds.
12 files changed:
src/BSplCLib/BSplCLib.cxx
src/BSplCLib/BSplCLib.hxx
src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Curve.cxx
tests/bugs/modalg_8/bug33187 [new file with mode: 0644]
tests/hlr/poly_hlr/A1
tests/hlr/poly_hlr/A2
tests/hlr/poly_hlr/A3
tests/hlr/poly_hlr/A4
tests/hlr/poly_hlr/A5
tests/hlr/poly_hlr/A6
tests/hlr/poly_hlr/A7