summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 0a6b23902..c3916dcf7 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1763,7 +1763,12 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
uint count = 0;
for (uint i = 0; i < TAB_COUNT; i++) {
- uint num = lang_pack->offsets[i];
+ uint16 num = lang_pack->offsets[i];
+ if (num > TAB_SIZE) {
+ free(lang_pack);
+ return false;
+ }
+
_langtab_start[i] = count;
_langtab_num[i] = num;
count += num;