[Scummvm-git-logs] scummvm-tools master -> 5e8b9439c19159303e84c3e093f374707337d32f

criezy criezy at scummvm.org
Mon Jan 30 23:33:32 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
5e8b9439c1 TOOLS: Fix memory corruption in extract_cine tool


Commit: 5e8b9439c19159303e84c3e093f374707337d32f
    https://github.com/scummvm/scummvm-tools/commit/5e8b9439c19159303e84c3e093f374707337d32f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-01-30T22:33:13Z

Commit Message:
TOOLS: Fix memory corruption in extract_cine tool

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.

Changed paths:
    NEWS
    engines/cine/extract_cine.cpp


diff --git a/NEWS b/NEWS
index 8ffd1d6..ea48edb 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/engines/cine/extract_cine.cpp b/engines/cine/extract_cine.cpp
index 09b8db9..7df05cc 100644
--- a/engines/cine/extract_cine.cpp
+++ b/engines/cine/extract_cine.cpp
@@ -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);
 		}
 	}





More information about the Scummvm-git-logs mailing list