diff options
author | Gregory Montoir | 2006-02-25 18:26:16 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-02-25 18:26:16 +0000 |
commit | 164f35b8788a43aaa3807ab9cc2c46f74e0a592d (patch) | |
tree | e64d5b469af7a44fcf4ddad17f679329a6687d74 /engines/cine/part.cpp | |
parent | bb4d4631385dbd9bec4dc67f9040878c92f41b26 (diff) | |
download | scummvm-rg350-164f35b8788a43aaa3807ab9cc2c46f74e0a592d.tar.gz scummvm-rg350-164f35b8788a43aaa3807ab9cc2c46f74e0a592d.tar.bz2 scummvm-rg350-164f35b8788a43aaa3807ab9cc2c46f74e0a592d.zip |
cleanup unpacking function and get rid of an old hack to prevent buffer overflows.
svn-id: r20884
Diffstat (limited to 'engines/cine/part.cpp')
-rw-r--r-- | engines/cine/part.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index 7ad3998546..74069531a2 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -203,14 +203,10 @@ uint8 *readBundleFile(int16 foundFileIdx) { if (partBuffer[foundFileIdx].unpackedSize != partBuffer[foundFileIdx].packedSize) { uint8 *unpackBuffer; - uint16 realSize; - unpackBuffer = (uint8 *)malloc(partBuffer[foundFileIdx].packedSize + 500); + unpackBuffer = (uint8 *)malloc(partBuffer[foundFileIdx].packedSize); readFromPart(foundFileIdx, unpackBuffer); - - realSize = READ_BE_UINT32(unpackBuffer + partBuffer[foundFileIdx].packedSize - 4); - - decomp(unpackBuffer + partBuffer[foundFileIdx].packedSize - 4, dataPtr + realSize, realSize); + delphineUnpack(dataPtr, unpackBuffer, partBuffer[foundFileIdx].packedSize); free(unpackBuffer); } else { readFromPart(foundFileIdx, dataPtr); |