Skip to content

Commit

Permalink
TOOLS: Fix memory corruption in extract_cine tool
Browse files Browse the repository at this point in the history
When reading an uncompressed VOL.CNF file, it was not correctly
getting the size of the file, and as a result not enough memory was
allocated to read the file (8 bytes instead of the file size). This caused
writes to occur outside of the allocated memory.
  • Loading branch information
criezy committed Jan 30, 2017
1 parent a38f178 commit 5e8b943
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -5,6 +5,8 @@ For a more comprehensive changelog of the latest experimental code, see:
- Fix handling of output path for the compress_touche tool.
- Fix handling of input path for the extract_cine tool. It was only working
when run from the directory that contains the game data.
- Fix memory corruption that could cause random errors during extraction when
using the extract_cine tool.

1.9.0 (2016-10-27)
- Fix random crashes in the tool to convert Broken Sword 1 speech files.
Expand Down
2 changes: 1 addition & 1 deletion engines/cine/extract_cine.cpp
Expand Up @@ -260,7 +260,7 @@ void ExtractCine::unpackAllResourceFiles(const Common::Filename &filename) {
unpackedSize = f.readUint32BE();
packedSize = f.readUint32BE();
} else {
unpackedSize = packedSize = f.pos(); /* Get file size */
unpackedSize = packedSize = f.size(); /* Get file size */
f.seek(0, SEEK_SET);
}
}
Expand Down

0 comments on commit 5e8b943

Please sign in to comment.