mirror of
https://github.com/ZDoom/zdbsp.git
synced 2025-02-13 23:51:05 +00:00
- ZDBSP fix: The program could hang on badly set up polyobjects. Now it aborts when the
loop iterates NumberOfSegs times. SVN r1337 (trunk)
This commit is contained in:
parent
1d692748f0
commit
ba25ef01f6
1 changed files with 3 additions and 1 deletions
|
@ -404,6 +404,7 @@ bool FNodeBuilder::GetPolyExtents (int polynum, fixed_t bbox[4])
|
|||
{
|
||||
vertex_t start;
|
||||
unsigned int vert;
|
||||
unsigned int count = 0;
|
||||
|
||||
vert = Segs[i].v1;
|
||||
|
||||
|
@ -415,7 +416,8 @@ bool FNodeBuilder::GetPolyExtents (int polynum, fixed_t bbox[4])
|
|||
AddSegToBBox (bbox, &Segs[i]);
|
||||
vert = Segs[i].v2;
|
||||
i = Vertices[vert].segs;
|
||||
} while (i != DWORD_MAX && (Vertices[vert].x != start.x || Vertices[vert].y != start.y));
|
||||
count++; // to prevent endless loops. Stop when this reaches the number of segs.
|
||||
} while (i != DWORD_MAX && (Vertices[vert].x != start.x || Vertices[vert].y != start.y) && count < Segs.Size());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue