]> OCCT Git - occt.git/commit
Modeling - Fix array indexing bug in IntAna_IntQuadQuad::NextCurve method (#703)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sat, 6 Sep 2025 12:36:48 +0000 (13:36 +0100)
committerGitHub <noreply@github.com>
Sat, 6 Sep 2025 12:36:48 +0000 (13:36 +0100)
commit80ce783ca2214e8a7028e882bb569bbb189218bf
tree1b5fe1845343c84ef29c21d2a1651365b0faa038
parent7dbd20076b9895499a1036559e62621fc7f3bb1b
Modeling - Fix array indexing bug in IntAna_IntQuadQuad::NextCurve method (#703)

Fixed a critical indexing bug in IntAna_IntQuadQuad::NextCurve where the
  method incorrectly used nextcurve[I] instead of nextcurve[I-1] for
  determining the theOpposite parameter.
This mismatch between 1-indexed API
  parameters and 0-indexed array access could lead to out-of-bounds memory
  access and incorrect curve connectivity determination.

Changes:
  - Fix IntAna_IntQuadQuad::NextCurve to use consistent I-1 indexing for both
   condition check and return value
  - Add comprehensive GTests covering NextCurve functionality, edge cases,
  and performance
  - Ensure proper error handling for invalid curve indices
src/ModelingData/TKGeomBase/GTests/FILES.cmake
src/ModelingData/TKGeomBase/GTests/IntAna_IntQuadQuad_Test.cxx [new file with mode: 0644]
src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx