From 8cccb158e98a4a5c93d85fe2e09d3937855c4675 Mon Sep 17 00:00:00 2001 From: glx Date: Sun, 28 Jul 2019 17:02:41 +0200 Subject: [PATCH] Fix #7672: more than 32 resolutions may be available --- src/strings.cpp | 2 +- src/strings_type.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index 5d186e7177..5593f6ba05 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1673,7 +1673,7 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c } /* resolution size? */ - if (IsInsideMM(ind, (SPECSTR_RESOLUTION_START - 0x70E4), (SPECSTR_RESOLUTION_END - 0x70E4) + 1)) { + if (IsInsideBS(ind, (SPECSTR_RESOLUTION_START - 0x70E4), _resolutions.size())) { int i = ind - (SPECSTR_RESOLUTION_START - 0x70E4); buff += seprintf( buff, last, "%ux%u", _resolutions[i].width, _resolutions[i].height diff --git a/src/strings_type.h b/src/strings_type.h index aa3ed788c3..11eeef1532 100644 --- a/src/strings_type.h +++ b/src/strings_type.h @@ -93,9 +93,8 @@ enum SpecialStrings { SPECSTR_LANGUAGE_START = 0x7100, SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1, - /* reserve 32 strings for various screen resolutions */ + /* reserve strings for various screen resolutions MUST BE THE LAST VALUE IN THIS ENUM */ SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1, - SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F, }; #endif /* STRINGS_TYPE_H */