Skip to content

Commit

Permalink
Mesh: Fix bogus portal range check
Browse files Browse the repository at this point in the history
Fixes: issue #1615
  • Loading branch information
dscharrer committed Apr 7, 2022
1 parent eb92e54 commit 1e993c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphics/data/Mesh.cpp
Expand Up @@ -848,8 +848,8 @@ static bool loadFastScene(const res::path & file, const char * data, const char

const EERIE_SAVE_PORTALS * epo = fts_read<EERIE_SAVE_PORTALS>(data, end);

if(epo->room_1 < 0 || size_t(epo->room_1) >= g_rooms->portals.size() ||
epo->room_1 < 0 || size_t(epo->room_1) >= g_rooms->portals.size()) {
if(epo->room_1 < 0 || size_t(epo->room_1) >= g_rooms->rooms.size() ||
epo->room_2 < 0 || size_t(epo->room_2) >= g_rooms->rooms.size()) {
throw std::runtime_error("portal room index out of bounds");
}
portal.room0 = epo->room_1;
Expand Down

0 comments on commit 1e993c0

Please sign in to comment.