mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023838: Modeling Data - Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
Fixed incorrect array allocation within GeomEvaluator_OffsetSurface::CalculateDN() and protection against assigning out-of-range values in case of non-square number of U and V derivatives on surface.
This commit is contained in:
@@ -191,13 +191,21 @@ static void derivatives(Standard_Integer theMaxOrder,
|
||||
else
|
||||
{
|
||||
for (i = 0; i <= theMaxOrder + theNU+ 1; i++)
|
||||
{
|
||||
for (j = i; j <= theMaxOrder + theNV + 1; j++)
|
||||
{
|
||||
if (i + j > theMinOrder)
|
||||
{
|
||||
theDerSurf.SetValue(i, j, theBasisSurf->DN(theU, theV, i, j));
|
||||
if (i != j)
|
||||
if (i != j
|
||||
&& j <= theDerSurf.UpperRow()
|
||||
&& i <= theDerSurf.UpperCol())
|
||||
{
|
||||
theDerSurf.SetValue(j, i, theBasisSurf->DN(theU, theV, j, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i <= theMaxOrder + theNU; i++)
|
||||
for (j = 0; j <= theMaxOrder + theNV; j++)
|
||||
theDerNUV.SetValue(i, j, CSLib::DNNUV(i, j, theDerSurf));
|
||||
@@ -776,7 +784,7 @@ gp_Vec GeomEvaluator_OffsetSurface::CalculateDN(
|
||||
CSLib::Normal(theD1U, theD1V, the_D1MagTol, NStatus, Normal);
|
||||
const Standard_Integer MaxOrder = (NStatus == CSLib_Defined) ? 0 : 3;
|
||||
Standard_Integer OrderU, OrderV;
|
||||
TColgp_Array2OfVec DerNUV(0, MaxOrder + theNu, 0, MaxOrder + theNu);
|
||||
TColgp_Array2OfVec DerNUV(0, MaxOrder + theNu, 0, MaxOrder + theNv);
|
||||
TColgp_Array2OfVec DerSurf(0, MaxOrder + theNu + 1, 0, MaxOrder + theNv + 1);
|
||||
|
||||
Standard_Real Umin = 0, Umax = 0, Vmin = 0, Vmax = 0;
|
||||
|
Reference in New Issue
Block a user