mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 04:16:34 +00:00
CRYOMNI3D: Fix two Coverity issues
- memory leak in loadHLZ when file couldn't be opened (CID 1401735) - use of out of scope reference (nullptr) when script couldn't be found (CID 1401734)
This commit is contained in:
parent
ba147f5ad5
commit
b5bd7f4bee
@ -194,8 +194,6 @@ void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::Soun
|
||||
Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::String &filename) {
|
||||
Common::String fname(prepareFileName(filename, "hlz"));
|
||||
|
||||
Image::ImageDecoder *imageDecoder = new Image::HLZFileDecoder();
|
||||
|
||||
Common::File file;
|
||||
|
||||
if (!file.open(fname)) {
|
||||
@ -203,6 +201,8 @@ Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::String &filename) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Image::ImageDecoder *imageDecoder = new Image::HLZFileDecoder();
|
||||
|
||||
if (!imageDecoder->loadStream(file)) {
|
||||
warning("Failed to open hlz file %s", fname.c_str());
|
||||
delete imageDecoder;
|
||||
|
@ -1513,7 +1513,7 @@ void CryOmni3DEngine_Versailles::executeSeeAction(uint actionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const FixedImgCallback &cb = _imgScripts.getVal(actionId, nullptr);
|
||||
const FixedImgCallback cb = _imgScripts.getVal(actionId, nullptr);
|
||||
if (cb != nullptr) {
|
||||
handleFixedImg(cb);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user