diff options
author | Torbjörn Andersson | 2014-10-25 20:57:52 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2014-10-25 20:57:52 +0200 |
commit | 0579bf6f18e56410e1b94e97034c8db774e73b06 (patch) | |
tree | d44e6612a9052a5b26982a77972b91f61343a4dd /engines/prince | |
parent | b6302c6e5155af097940c0043e1b7941c2c1fefe (diff) | |
download | scummvm-rg350-0579bf6f18e56410e1b94e97034c8db774e73b06.tar.gz scummvm-rg350-0579bf6f18e56410e1b94e97034c8db774e73b06.tar.bz2 scummvm-rg350-0579bf6f18e56410e1b94e97034c8db774e73b06.zip |
PRINCE: Fix potential out-of-bounds reads (CID 1248500, 1248503)
Since heroSetTable[] is an array of int, use >= ARRAYSIZE() instead
of > sizeof().
Diffstat (limited to 'engines/prince')
-rw-r--r-- | engines/prince/hero.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index 06fba25ba9..146470f6b7 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -54,7 +54,7 @@ Hero::~Hero() { bool Hero::loadAnimSet(uint32 animSetNr) { _animSetNr = animSetNr; - if (animSetNr > sizeof(heroSetTable)) { + if (animSetNr >= ARRAYSIZE(heroSetTable)) { return false; } |