[Scummvm-git-logs] scummvm-tools master -> 1bb23d74e56745e545c78e976d4912b1419777ef

sev- sev at scummvm.org
Tue Sep 10 16:27:45 CEST 2019


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

Summary:
16f96eb5d8 TOOLS: Fix few warnings and memory leaks
1bb23d74e5 TOOLS: update news file with recent additions


Commit: 16f96eb5d84cb846ce503e6f4d88f1c082e49cdf
    https://github.com/scummvm/scummvm-tools/commit/16f96eb5d84cb846ce503e6f4d88f1c082e49cdf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-10T16:21:10+02:00

Commit Message:
TOOLS: Fix few warnings and memory leaks

Changed paths:
    decompiler/control_flow.cpp
    decompiler/decompiler.cpp
    decompiler/groovie/disassembler.cpp
    engines/bladerunner/pack_bladerunner.cpp
    engines/cge/pack_cge.cpp
    engines/hdb/extract_hdb.cpp
    engines/kyra/kyra_pak.cpp
    engines/queen/compress_queen.cpp
    engines/tony/compress_tony_vdb.cpp


diff --git a/decompiler/control_flow.cpp b/decompiler/control_flow.cpp
index f3ae71b..d4a9375 100644
--- a/decompiler/control_flow.cpp
+++ b/decompiler/control_flow.cpp
@@ -260,7 +260,7 @@ void ControlFlow::createGroups() {
 		setStackLevel(fn->second._v, 0);
 	ConstInstIterator curInst, nextInst;
 	nextInst = _insts.begin();
-	nextInst++;
+	++nextInst;
 	int stackLevel = 0;
 	int expectedStackLevel = 0;
 	for (curInst = _insts.begin(); nextInst != _insts.end(); ++curInst, ++nextInst) {
diff --git a/decompiler/decompiler.cpp b/decompiler/decompiler.cpp
index fdaf99a..6dadb35 100644
--- a/decompiler/decompiler.cpp
+++ b/decompiler/decompiler.cpp
@@ -85,7 +85,7 @@ int main(int argc, char** argv) {
 			std::cout << "Available engines:" << "\n";
 
 			std::map<std::string, std::string>::iterator it;
-			for (it = engines.begin(); it != engines.end(); it++)
+			for (it = engines.begin(); it != engines.end(); ++it)
 				std::cout << (*it).first << " " << (*it).second << "\n";
 
 			return 0;
diff --git a/decompiler/groovie/disassembler.cpp b/decompiler/groovie/disassembler.cpp
index 7a483ca..4fcc9f3 100644
--- a/decompiler/groovie/disassembler.cpp
+++ b/decompiler/groovie/disassembler.cpp
@@ -68,7 +68,7 @@ uint32 GroovieJumpInstruction::getDestAddress() const {
 	while (i != _params.end()) {
 		if ((*i)->isAddress())
 			return (*i)->getUnsigned();
-		i++;
+		++i;
 	}
 	return 0;
 }
diff --git a/engines/bladerunner/pack_bladerunner.cpp b/engines/bladerunner/pack_bladerunner.cpp
index 8e01565..d369bd6 100644
--- a/engines/bladerunner/pack_bladerunner.cpp
+++ b/engines/bladerunner/pack_bladerunner.cpp
@@ -70,7 +70,7 @@ void PackBladeRunner::execute() {
 	mainDir.setFullName("CDFRAMES.DAT");
 	if (!mainDir.exists()) {
 		warning("Could not find file %s", mainDir.getName().c_str());
-		snprintf(fname, 20, "CDFRAMES%d.DAT", curCD);		
+		snprintf(fname, 20, "CDFRAMES%d.DAT", curCD);
 		mainDir.setFullName(fname);
 		warning("Retrying for file %s", mainDir.getName().c_str());
 	}
@@ -78,6 +78,9 @@ void PackBladeRunner::execute() {
 
 	if (!in.isOpen()) {
 		warning("Cannot open file %s", mainDir.getName().c_str());
+		free(buf);
+		free(cdPageOffsets);
+		free(hdPageOffsets);
 		return;
 	}
 
diff --git a/engines/cge/pack_cge.cpp b/engines/cge/pack_cge.cpp
index ba74a41..99b3f9b 100644
--- a/engines/cge/pack_cge.cpp
+++ b/engines/cge/pack_cge.cpp
@@ -31,11 +31,14 @@ PackCge::PackCge(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION/*TOOL
 	input.format = "/";
 	input.file = false;
 	_inputPaths.push_back(input);
-	
+
 	_outputToDirectory = true;
 
 	_shorthelp = "Used to repackage Soltys and Sfinx data files.";
 	_helptext = "\nUsage: " + getName() + " [-o /path/to/output/dir/] /path/to/one_game_file\n";
+
+	for (uint i = 0; i < MAX_FILES; i++)
+		memset(_files[i], 0, kBtKeySize);
 }
 
 void PackCge::execute() {
@@ -63,7 +66,7 @@ void PackCge::execute() {
 
 		// Handle the old CGE1 format:
 		verHeader = std::string("CGE1");
-		if (sversion.compare(verHeader) != 0) 
+		if (sversion.compare(verHeader) != 0)
 			_fIn.seek(0, SEEK_SET); // So we have to rewind the file, since there's no header.
 	}
 
@@ -129,7 +132,7 @@ void PackCge::writeData(Common::File &f, byte *buff, int size) {
 void PackCge::pack() {
 	BtPage btPage;
 	print("Packing as CGE1...");
-	
+
 	/* Build the index page */
 	// Header
 	memset(&btPage, 0, sizeof(BtPage));
@@ -200,7 +203,7 @@ void PackCge::pack() {
 void PackCge::pack2() {
 	BtPage2 btPage2;
 	print("Packing as CGE2...");
-	
+
 	/* Build the index page */
 	// Header
 	memset(&btPage2, 0, sizeof(BtPage2));
@@ -274,5 +277,3 @@ int main(int argc, char *argv[]) {
 	return cge.run(argc, argv);
 }
 #endif
-
-
diff --git a/engines/hdb/extract_hdb.cpp b/engines/hdb/extract_hdb.cpp
index ec2ce0b..71066d5 100644
--- a/engines/hdb/extract_hdb.cpp
+++ b/engines/hdb/extract_hdb.cpp
@@ -46,7 +46,7 @@ void ExtractHDB::execute() {
 		error("Unable to open %s", filename.getFullName().c_str());
 
 	Common::File fOut;
-	for (Common::Array<MPCEntry *>::iterator it = _dir.begin(); it != _dir.end(); it++) {
+	for (Common::Array<MPCEntry *>::iterator it = _dir.begin(); it != _dir.end(); ++it) {
 		byte *buffer = (byte *)malloc((*it)->length);
 
 		_mpcFile.seek((*it)->offset, SEEK_SET);
diff --git a/engines/kyra/kyra_pak.cpp b/engines/kyra/kyra_pak.cpp
index 4f936fe..a3a16c1 100644
--- a/engines/kyra/kyra_pak.cpp
+++ b/engines/kyra/kyra_pak.cpp
@@ -464,6 +464,7 @@ bool Extractor::outputAllFiles(Common::Filename *outputPath) {
 			printf("OK\n");
 		} else {
 			printf("FAILED\n");
+			fclose(file);
 			return false;
 		}
 		fclose(file);
@@ -496,4 +497,3 @@ bool Extractor::outputFileAs(const char *f, const char *fn) {
 	fclose(file);
 	return true;
 }
-
diff --git a/engines/queen/compress_queen.cpp b/engines/queen/compress_queen.cpp
index 41a0666..fe1dfc9 100644
--- a/engines/queen/compress_queen.cpp
+++ b/engines/queen/compress_queen.cpp
@@ -101,6 +101,8 @@ CompressQueen::CompressQueen(const std::string &name) : CompressionTool(name, TO
 
 	_shorthelp = "Used to compress Flight of the Amazon Queen data files.";
 	_helptext = "\nUsage: " + getName() + " [mode] [mode params] [-o outputdir] <inputfile (queen.1)>\n\t" + _shorthelp + "\n";
+
+	_version = NULL;
 }
 
 const CompressQueen::GameVersion *CompressQueen::detectGameVersion(uint32 size) {
@@ -328,4 +330,3 @@ int main(int argc, char *argv[]) {
 	return queen.run(argc, argv);
 }
 #endif
-
diff --git a/engines/tony/compress_tony_vdb.cpp b/engines/tony/compress_tony_vdb.cpp
index d8f59b6..0befc91 100644
--- a/engines/tony/compress_tony_vdb.cpp
+++ b/engines/tony/compress_tony_vdb.cpp
@@ -114,7 +114,7 @@ bool CompressTonyVDB::convertTonyADPCMSample() {
 	for (uint32 i = 0; i < _uncompressedSize; i++)
 		curFileHandle.writeUint16LE(_outBuffer[i]);
 	curFileHandle.close();
-	
+
 	// Encode this raw data...
 	setRawAudioType(true, false, 16); // LE, stereo, 16-bit
 	encodeAudio(TEMP_RAW, true, _rate, TEMP_ENC, _format);
@@ -165,6 +165,7 @@ void CompressTonyVDB::execute() {
 		outpath_enc.setExtension(".FDB");
 		break;
 	default:
+		delete[] vh;
 		throw ToolException("Unknown audio format");
 		break;
 	}
@@ -240,6 +241,8 @@ void CompressTonyVDB::execute() {
 	/* And some clean-up :-) */
 	Common::removeFile(TEMP_RAW);
 	Common::removeFile(TEMP_ENC);
+
+	delete[] vh;
 }
 
 


Commit: 1bb23d74e56745e545c78e976d4912b1419777ef
    https://github.com/scummvm/scummvm-tools/commit/1bb23d74e56745e545c78e976d4912b1419777ef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-10T16:27:36+02:00

Commit Message:
TOOLS: update news file with recent additions

Changed paths:
    NEWS


diff --git a/NEWS b/NEWS
index 1a61df5..7df862c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,15 @@
 For a more comprehensive changelog of the latest experimental code, see:
         https://github.com/scummvm/scummvm-tools/commits/
 
-2.1.0 (2018-??-??)
+2.1.0 (2019-10-??)
  - Fix bug #10559: Add workaround to compress_scumm_sou for non-VOC speech
    sample in monster.sou of Indiana Jones and the Fate of Atlantis.
  - Improve endianness handling of internal FLAC encoder.
+ - Add tool to create HDFRAMES.DAT file for Blade Runner game.
+ - Major rewrite of extract_prince tool.
+ - Implement decompiler for Prince game scripts.
+ - Rework the Mohawk engine tools.
+ - Add tool to extract Hyperspace Delivery Boy! game archives.
 
 2.0.0 (2017-12-17)
  - Fix handling of output path for the compress_touche tool.
@@ -55,7 +60,7 @@ For a more comprehensive changelog of the latest experimental code, see:
 1.4.0 (2011-11-11)
  - Updated the compress_sci tool to add support for compressing the AUDIO001.002
    audio files of the CD versions of King's Quest 5 and Jones in the Fast Lane.
-   
+
 1.3.0 (2011-05-28)
  - Fix bug #3092367: "TOOLS: Improve GUI for Ogg encoding options".
 





More information about the Scummvm-git-logs mailing list