mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-25 05:51:15 +00:00
Fix pot. Crash in idWinding2D::ExpandForAxialBox()
it could happen that i is 1 but numPlanes is still 0 (=> if for i = 0: ( p[j] - p[i] ).LengthSqr() < 0.01f ) so planes[-1] would be accessed which of course is invalid and can crash
This commit is contained in:
parent
885f594a59
commit
fd514f2281
1 changed files with 1 additions and 1 deletions
|
@ -84,7 +84,7 @@ void idWinding2D::ExpandForAxialBox( const idVec2 bounds[2] ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
plane = Plane2DFromPoints( p[i], p[j], true );
|
plane = Plane2DFromPoints( p[i], p[j], true );
|
||||||
if ( i ) {
|
if ( numPlanes > 0 ) {
|
||||||
if ( GetAxialBevel( planes[numPlanes-1], plane, p[i], bevel ) ) {
|
if ( GetAxialBevel( planes[numPlanes-1], plane, p[i], bevel ) ) {
|
||||||
planes[numPlanes++] = bevel;
|
planes[numPlanes++] = bevel;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue