mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0025770: Possible "invalid memory access"
Memory problems fixed.
This commit is contained in:
parent
0b0320e76e
commit
31e0b8e84c
@ -481,8 +481,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
|
|||||||
|
|
||||||
new_par.Append(lcons);
|
new_par.Append(lcons);
|
||||||
New_NCONTROL = new_par.Length() - 1;
|
New_NCONTROL = new_par.Length() - 1;
|
||||||
//simple protection if New_NCONTROL > allocated elements in array
|
// Simple protection if New_NCONTROL > allocated elements in array but one
|
||||||
if (New_NCONTROL > aMaxArraySize) {
|
// aMaxArraySize - 1 index may be filled after projection.
|
||||||
|
if (New_NCONTROL > aMaxArraySize - 1) {
|
||||||
mySameParameter = Standard_False;
|
mySameParameter = Standard_False;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -788,7 +788,7 @@ void GeomInt_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& aLine,
|
|||||||
aT=pVtx[1].Value()+aTwoPI;
|
aT=pVtx[1].Value()+aTwoPI;
|
||||||
pVtx[aNbVtx-1].SetValue(aT);
|
pVtx[aNbVtx-1].SetValue(aT);
|
||||||
//
|
//
|
||||||
for(i=0; i<aNbVtx; ++i) {
|
for(i=0; i<aNbVtx - 1; ++i) {
|
||||||
aT=pVtx[i+1].Value();
|
aT=pVtx[i+1].Value();
|
||||||
pVtx[i].SetValue(aT);
|
pVtx[i].SetValue(aT);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user