[Scummvm-git-logs] scummvm master -> ab8ee18ad915f70df6199d5b8d340ad529f1796e

sev- sev at scummvm.org
Tue Jul 14 22:59:55 UTC 2020


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:
ab8ee18ad9 DIRECTOR: Fix crahs on empty preload in VWFI


Commit: ab8ee18ad915f70df6199d5b8d340ad529f1796e
    https://github.com/scummvm/scummvm/commit/ab8ee18ad915f70df6199d5b8d340ad529f1796e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-07-15T00:59:23+02:00

Commit Message:
DIRECTOR: Fix crahs on empty preload in VWFI

Changed paths:
    engines/director/movie.cpp


diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index bea106c128..95b0317f9e 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -201,11 +201,14 @@ void Movie::loadFileInfo(Common::SeekableSubReadStreamEndian &stream) {
 	_changedBy = fileInfoStrings[1].readString();
 	_createdBy = fileInfoStrings[2].readString();
 	_createdBy = fileInfoStrings[3].readString();
-	uint16 preload;
-	if (stream.isBE())
-		preload = READ_BE_INT16(fileInfoStrings[4].data);
-	else
-		preload = READ_LE_INT16(fileInfoStrings[4].data);
+
+	uint16 preload = 0;
+	if (fileInfoStrings[4].len) {
+		if (stream.isBE())
+			preload = READ_BE_INT16(fileInfoStrings[4].data);
+		else
+			preload = READ_LE_INT16(fileInfoStrings[4].data);
+	}
 
 	if (debugChannelSet(3, kDebugLoading)) {
 		debug("VWFI: script: '%s'", _script.c_str());




More information about the Scummvm-git-logs mailing list