MM: MM1: Fix crash on roster load

Do not ignore EOS when loading roster save.
This prevents a comparison with an uninitialized variable.

Fixes #14509
This commit is contained in:
PushmePullyu 2023-06-12 04:13:53 +02:00 committed by Paul Gilbert
parent 8a5c818d61
commit 1ae8852549

View File

@ -51,7 +51,7 @@ void Roster::load() {
while (!sf->eos()) {
uint32 chunk = sf->readUint32BE();
if (chunk == MKTAG('M', 'A', 'P', 'S')) {
if (!sf->eos() && chunk == MKTAG('M', 'A', 'P', 'S')) {
sf->skip(4); // Skip chunk size
g_maps->synchronize(s);
}