]> 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)
committervglukhik <vglukhik@opencascade.com>
Fri, 17 Mar 2023 23:04:00 +0000 (23:04 +0000)
commit6447aae244ff8fd702b94f4d438668f6e625d63b
tree05ae2f1fac4d533b8a79aa7ea0a2a3edc94f9d22
parentd6b9f64152ef22ca3ccd9e1b6bdc852f244f7a5d
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