mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-21 20:21:19 +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
5b3d99275f
commit
85a1020490
1 changed files with 1 additions and 1 deletions
|
@ -84,7 +84,7 @@ void idWinding2D::ExpandForAxialBox( const idVec2 bounds[2] ) {
|
|||
continue;
|
||||
}
|
||||
plane = Plane2DFromPoints( p[i], p[j], true );
|
||||
if ( i ) {
|
||||
if ( numPlanes > 0 ) {
|
||||
if ( GetAxialBevel( planes[numPlanes-1], plane, p[i], bevel ) ) {
|
||||
planes[numPlanes++] = bevel;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue