[Scummvm-git-logs] scummvm master -> b8e5ec1a9bc6e568efb11990d80e80ef3a411827
Marisa-Chan
noreply at scummvm.org
Wed Mar 11 06:58:29 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b8e5ec1a9b GAMOS: Fix Unchecked return value CID 1645148, 1645151
Commit: b8e5ec1a9bc6e568efb11990d80e80ef3a411827
https://github.com/scummvm/scummvm/commit/b8e5ec1a9bc6e568efb11990d80e80ef3a411827
Author: Marisa-Chan (thunder_8888 at mail.ru)
Date: 2026-03-11T13:58:13+07:00
Commit Message:
GAMOS: Fix Unchecked return value CID 1645148, 1645151
Changed paths:
engines/gamos/music.cpp
engines/gamos/video.cpp
diff --git a/engines/gamos/music.cpp b/engines/gamos/music.cpp
index f188ac21b31..75bfed7d6d0 100644
--- a/engines/gamos/music.cpp
+++ b/engines/gamos/music.cpp
@@ -28,7 +28,9 @@ MidiMusic::MidiMusic() {
MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_PREFER_GM);
_driver = MidiDriver::createMidi(dev);
- _driver->open();
+ int returnCode = _driver->open();
+ if (returnCode != 0)
+ error("MidiMusic::MidiMusic _driver->open() - Failed to open MIDI music driver - error code %d.", returnCode);
_driver->sendGMReset();
}
diff --git a/engines/gamos/video.cpp b/engines/gamos/video.cpp
index 0b5e09f84cd..1a9c4436b3f 100644
--- a/engines/gamos/video.cpp
+++ b/engines/gamos/video.cpp
@@ -74,13 +74,14 @@ void GamosEngine::playVideo(const Common::String &video, const Common::Point &po
if (SearchMan.hasFile(bmpPath)) {
Common::File f;
if (f.open(bmpPath)) {
- bmp.loadStream(f);
- f.close();
+ if (bmp.loadStream(f)) {
+ bkg = bmp.getSurface();
+ bkgPalette = bmp.getPalette().data();
+ bkgPaletteCount = bmp.getPalette().size();
+ loadbkg = true;
+ }
- bkg = bmp.getSurface();
- bkgPalette = bmp.getPalette().data();
- bkgPaletteCount = bmp.getPalette().size();
- loadbkg = true;
+ f.close();
}
}
More information about the Scummvm-git-logs
mailing list