diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 8ac9713a7..db979644d 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -20,6 +20,7 @@ #include "Policies/SingletonImp.h" #include "Log.h" #include "ProgressBar.h" +#include "SharedDefines.h" #include "DBCfmt.h" @@ -391,9 +392,13 @@ void LoadDBCStores(const std::string& dataPath) if(!talentTabInfo) continue; + // prevent memory corruption; otherwise cls will become 12 below + if (! talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) + continue; + // store class talent tab pages uint32 cls = 1; - for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < 12 /*MAX_CLASSES*/;m <<=1, ++cls) {} + for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {} sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 75a94e0cc..f4fdd3594 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7581" + #define REVISION_NR "7582" #endif // __REVISION_NR_H__