1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0030594: Data Exchange - access violation within IGESGeom_BSplineCurve constructor

Added NULL check.
This commit is contained in:
kgv
2019-03-20 09:50:52 +03:00
committed by apn
parent cb6cad7df1
commit de07af824b
2 changed files with 18 additions and 8 deletions

View File

@@ -40,13 +40,23 @@ IGESGeom_BSplineCurve::IGESGeom_BSplineCurve () { }
const Standard_Real aUmin, const Standard_Real aUmax,
const gp_XYZ& aNorm)
{
if (!allPoles.IsNull()) {
if (allPoles->Length() != allWeights->Length())
throw Standard_DimensionMismatch("IGESGeom_BSplineCurve : Init");
if (allKnots->Lower() != -aDegree || allKnots->Upper() != anIndex+1 ||
allWeights->Upper() != anIndex ||
allWeights->Lower() != 0 || allPoles->Lower() != 0)
throw Standard_DimensionMismatch("IGESGeom_BSplineCurve : Init");
if (!allPoles.IsNull())
{
if (allKnots->Lower() != -aDegree
|| allKnots->Upper() != anIndex + 1
|| allPoles->Lower() != 0)
{
throw Standard_DimensionMismatch ("IGESGeom_BSplineCurve : Init");
}
if (!allWeights.IsNull())
{
if (allPoles->Length() != allWeights->Length()
|| allWeights->Upper() != anIndex
|| allWeights->Lower() != 0)
{
throw Standard_DimensionMismatch ("IGESGeom_BSplineCurve : Init");
}
}
}
theIndex = anIndex;