Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Fix crash caused by some broken models
Browse files Browse the repository at this point in the history
  • Loading branch information
mitrokosta committed Sep 3, 2021
1 parent 630e6fe commit d6eb6d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/geometry/src/collide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ rec_loop:;
{
const long face = (static_cast<long>(*(pface + 2)) << 16) | (static_cast<long>(*(pface + 1)) << 8) |
(static_cast<long>(*(pface + 0)) << 0);
// "fix" for broken models
if (face < 0 || face >= sizeof(trgclip) / sizeof(*trgclip))
{
continue;
}

// this triangle was added before
if (trgclip[face] != attempt)
Expand Down

0 comments on commit d6eb6d0

Please sign in to comment.