game-strings: fix crash with -l/--level

This commit is contained in:
Marcin Kurczewski 2025-04-26 19:41:37 +02:00
parent 0ba717edd5
commit 28635447cb
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A

View file

@ -124,7 +124,7 @@ static void M_ApplyLayer(
}
}
if (gs_level_table != nullptr) {
if (gs_level_table != nullptr && gs_level_table->count != 0) {
ASSERT(level->num >= 0);
ASSERT(level->num < gs_level_table->count);
M_Apply(&gs_level_table->entries[level->num].table);