diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 35a6a1272..7f05287b2 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -388,7 +388,7 @@ void GameInfo::populate() memcpy(ROMserial+4, header.gameCode, 4); u32 region = (u32)(std::max(strchr(regions[0],header.gameCode[3]) - regions[0] + 1, 0)); - if (region != 0) + if (region > 0 && region < 12) strcat(ROMserial, regions[region]); else strcat(ROMserial, "Unknown");