diff options
author | Max Horn | 2010-10-18 19:03:24 +0000 |
---|---|---|
committer | Max Horn | 2010-10-18 19:03:24 +0000 |
commit | 277113f600fd0decf2908f36ba99e3254b2befc8 (patch) | |
tree | 61865f9cac350343706384e5208b4f88f5c5b18c /engines/scumm/smush | |
parent | cda2c950d64c660a30d0e9d8ec9b5923a26545d3 (diff) | |
download | scummvm-rg350-277113f600fd0decf2908f36ba99e3254b2befc8.tar.gz scummvm-rg350-277113f600fd0decf2908f36ba99e3254b2befc8.tar.bz2 scummvm-rg350-277113f600fd0decf2908f36ba99e3254b2befc8.zip |
SCUMM: Fix out of bound access (discovered by Code Analysis in MS VS2010; thanks to aquadran for helping verify the fix)
svn-id: r53575
Diffstat (limited to 'engines/scumm/smush')
-rw-r--r-- | engines/scumm/smush/codec47.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 62bc0bb098..333fdabccf 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -301,9 +301,11 @@ void Codec47Decoder::makeTables47(int width) { int32 a, c, d; int16 tmp; - for (int l = 0; l < 512; l += 2) { + for (int l = 0; l < ARRAYSIZE(codec47_table); l += 2) { _table[l / 2] = (int16)(codec47_table[l + 1] * width + codec47_table[l]); } + // Note: _table[255] is never inited; but since only the first 0xF8 + // entries of it are used anyway, this doesn't matter. a = 0; c = 0; |