mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
revert - comp_input can be more than 0x2000 size
svn-id: r12268
This commit is contained in:
parent
9d21fd44f0
commit
67dff87a92
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user