]> OCCT Git - occt.git/commit
0033187: Modeling Algorithms - Crash in postprocessing of imported shape
authoratereshi <andrey.tereshin@opencascade.com>
Wed, 26 Oct 2022 13:59:54 +0000 (16:59 +0300)
committerVadim Glukhikh <vadim.glukhikh@opencascade.com>
Mon, 21 Nov 2022 16:53:59 +0000 (19:53 +0300)
commitf9990707fec102f85688a9e197a64fd175b5dc4c
treed73599521ad823de7b19b05ae0cc89f2d8f821e3
parentaba5c241c606ce41dec2764e5ead9c078cc6fe31
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