diff options
author | Paweł Kołodziejski | 2004-01-08 23:17:54 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-01-08 23:17:54 +0000 |
commit | 67dff87a92e0358218763d6212a7dd18db1ccb3d (patch) | |
tree | 19793084f56f265472940b604ce43c837c24c511 /scumm | |
parent | 9d21fd44f0e980114ce7f8391a3e07279ef696b8 (diff) | |
download | scummvm-rg350-67dff87a92e0358218763d6212a7dd18db1ccb3d.tar.gz scummvm-rg350-67dff87a92e0358218763d6212a7dd18db1ccb3d.tar.bz2 scummvm-rg350-67dff87a92e0358218763d6212a7dd18db1ccb3d.zip |
revert - comp_input can be more than 0x2000 size
svn-id: r12268
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_digi/dimuse_bndmgr.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp index 7bc233df28..f477892c14 100644 --- a/scumm/imuse_digi/dimuse_bndmgr.cpp +++ b/scumm/imuse_digi/dimuse_bndmgr.cpp @@ -206,12 +206,10 @@ int32 BundleMgr::decompressSampleByIndex(int32 index, int32 offset, int32 size, int skip = offset - (first_block * 0x2000) + header_size; - // CMI hack: one more zero byte at the end of input buffer - comp_input = (byte *)malloc(0x2000); - comp_input[0x2000-1] = 0; - for (i = first_block; i <= last_block; i++) { - assert(0x2000 >= _compTable[i].size + 1); + // CMI hack: one more zero byte at the end of input buffer + comp_input = (byte *)malloc(_compTable[i].size + 1); + comp_input[_compTable[i].size] = 0; byte *curBuf; if (_lastBlock != i) { @@ -239,11 +237,11 @@ int32 BundleMgr::decompressSampleByIndex(int32 index, int32 offset, int32 size, final_size += output_size; size -= output_size; assert(size >= 0); + free(comp_input); if (size == 0) break; skip = 0; } - free(comp_input); free(comp_output); return final_size; |