[Scummvm-git-logs] scummvm master -> 2649c429dbf30e1035fbc2d59a70e390b30327b2

sev- sev at scummvm.org
Fri Aug 3 14:51:16 CEST 2018


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

Summary:
bafe22c782 GRAPHICS: Set thumbnail to nullptr when loading the thumbnail is skipped
2649c429db LAB: By default skip thumbnail loading for readSaveGameHeader


Commit: bafe22c782909b6f92cc42cfbf82a65d1167dc29
    https://github.com/scummvm/scummvm/commit/bafe22c782909b6f92cc42cfbf82a65d1167dc29
Author: David Fioramonti (dafioram at gmail.com)
Date: 2018-08-03T14:51:12+02:00

Commit Message:
GRAPHICS: Set thumbnail to nullptr when loading the thumbnail is skipped

Since Graphics::loadThumbnail can return successfully when a thumbnail is skipped
the caller may want to check to the see that the thumbnail is not null before using
it. Setting it to null is just defensive in case the caller didn't do so.

If the user tries to use the thumbnail in setThumbnail then it will just
show a black screen for the thumbnail rather than crashing if they have
not set the thumbnail to null.

Changed paths:
    graphics/thumbnail.cpp


diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 72a06f9..c769591 100644
--- a/graphics/thumbnail.cpp
+++ b/graphics/thumbnail.cpp
@@ -149,6 +149,7 @@ bool skipThumbnail(Common::SeekableReadStream &in) {
 
 bool loadThumbnail(Common::SeekableReadStream &in, Graphics::Surface *&thumbnail, bool skipThumbnail) {
 	if (skipThumbnail) {
+		thumbnail = nullptr;
 		return Graphics::skipThumbnail(in);
 	}
 


Commit: 2649c429dbf30e1035fbc2d59a70e390b30327b2
    https://github.com/scummvm/scummvm/commit/2649c429dbf30e1035fbc2d59a70e390b30327b2
Author: David Fioramonti (dafioram at gmail.com)
Date: 2018-08-03T14:51:12+02:00

Commit Message:
LAB: By default skip thumbnail loading for readSaveGameHeader

This changes the convention back to skipping the thumbnail loading
for readSaveGameHeader. querySaveMetaInfos is the only place it
shouldn't be skipped.

Changed paths:
    engines/lab/detection.cpp
    engines/lab/lab.h


diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index bf6d456..9ce8519 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -208,7 +208,7 @@ SaveStateDescriptor LabMetaEngine::querySaveMetaInfos(const char *target, int sl
 	if (in) {
 		Lab::SaveGameHeader header;
 
-		bool successfulRead = Lab::readSaveGameHeader(in, header);
+		bool successfulRead = Lab::readSaveGameHeader(in, header, false);
 		delete in;
 
 		if (successfulRead) {
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 3eba78b..aedf018 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -502,7 +502,7 @@ private:
 	void handleTrialWarning();
 };
 
-WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header, bool skipThumbnail = false);
+WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header, bool skipThumbnail = true);
 
 } // End of namespace Lab
 





More information about the Scummvm-git-logs mailing list