[Scummvm-git-logs] scummvm master -> 183571f7c2292b78f8e632cb4de01ff108bf207c

bgK bastien.bouclet at gmail.com
Mon Nov 20 20:22:42 CET 2017


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

Summary:
183571f7c2 FULLPIPE: Fix loading inventory items from saves


Commit: 183571f7c2292b78f8e632cb4de01ff108bf207c
    https://github.com/scummvm/scummvm/commit/183571f7c2292b78f8e632cb4de01ff108bf207c
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-11-20T20:22:32+01:00

Commit Message:
FULLPIPE: Fix loading inventory items from saves

In C++ the function parameter evaluation order is undefined. The count
property was being read first from the stream, instead of the itemId.

Fixes #10324.

Changed paths:
    engines/fullpipe/inventory.cpp


diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 7cf8fe9..1a3c234 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -95,7 +95,9 @@ bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartiall
 	int numInvs = file.readUint32LE();
 
 	for (int i = 0; i < numInvs; i++) {
-		_inventoryItems.push_back(InventoryItem(file.readUint16LE(), file.readUint16LE()));
+		int16 itemId = file.readUint16LE();
+		int16 count = file.readUint16LE();
+		_inventoryItems.push_back(InventoryItem(itemId, count));
 	}
 
 	return true;





More information about the Scummvm-git-logs mailing list