PRINCE: Fix potential out-of-bounds reads (CID 1248500, 1248503)

Since heroSetTable[] is an array of int, use >= ARRAYSIZE() instead
of > sizeof().
This commit is contained in:
Torbjörn Andersson 2014-10-25 20:57:52 +02:00
parent b6302c6e51
commit 0579bf6f18

View File

@ -54,7 +54,7 @@ Hero::~Hero() {
bool Hero::loadAnimSet(uint32 animSetNr) {
_animSetNr = animSetNr;
if (animSetNr > sizeof(heroSetTable)) {
if (animSetNr >= ARRAYSIZE(heroSetTable)) {
return false;
}