mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-02 15:16:46 +00:00
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.
This commit is contained in:
parent
3922370275
commit
bafe22c782
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user