From 1e993c0abab73306aa369b231927534a0a3e56a3 Mon Sep 17 00:00:00 2001 From: Daniel Scharrer Date: Thu, 7 Apr 2022 19:49:22 +0200 Subject: [PATCH] Mesh: Fix bogus portal range check Fixes: issue #1615 --- src/graphics/data/Mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/data/Mesh.cpp b/src/graphics/data/Mesh.cpp index 3ba877d561..b3e60cba7b 100644 --- a/src/graphics/data/Mesh.cpp +++ b/src/graphics/data/Mesh.cpp @@ -848,8 +848,8 @@ static bool loadFastScene(const res::path & file, const char * data, const char const EERIE_SAVE_PORTALS * epo = fts_read(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;