From 4886b0581ee45f5360b96bccf061cec982ede9f3 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Wed, 20 Feb 2019 22:02:43 +0100 Subject: BLADERUNNER: Fix Coverity issues --- engines/bladerunner/ui/kia_section_load.cpp | 8 ++++++++ engines/bladerunner/ui/kia_section_save.cpp | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'engines/bladerunner/ui') diff --git a/engines/bladerunner/ui/kia_section_load.cpp b/engines/bladerunner/ui/kia_section_load.cpp index a512188b43..4d91fb51b0 100644 --- a/engines/bladerunner/ui/kia_section_load.cpp +++ b/engines/bladerunner/ui/kia_section_load.cpp @@ -42,6 +42,14 @@ KIASectionLoad::KIASectionLoad(BladeRunnerEngine *vm) : KIASectionBase(vm) { _uiContainer = new UIContainer(_vm); _scrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, 1025, 0, true, Common::Rect(155, 158, 461, 346), Common::Rect(506, 160, 506, 350)); _uiContainer->add(_scrollBox); + + _timeLast = 0; + _timeLeft = 0; + + _hoveredLineId = -1; + _newGameEasyLineId = -1; + _newGameMediumLineId = -1; + _newGameHardLineId = -1; } KIASectionLoad::~KIASectionLoad() { diff --git a/engines/bladerunner/ui/kia_section_save.cpp b/engines/bladerunner/ui/kia_section_save.cpp index 07873e39b7..46ee0384d2 100644 --- a/engines/bladerunner/ui/kia_section_save.cpp +++ b/engines/bladerunner/ui/kia_section_save.cpp @@ -54,6 +54,11 @@ KIASectionSave::KIASectionSave(BladeRunnerEngine *vm) : KIASectionBase(vm) { _buttons = new UIImagePicker(_vm, 3); + _timeLast = 0; + _timeLeft = 0; + + _state = kStateNormal; + _mouseX = 0; _mouseY = 0; @@ -384,6 +389,8 @@ void KIASectionSave::save() { Common::OutSaveFile *saveFile = BladeRunner::SaveFileManager::openForSaving(_vm->getTargetName(), slot); if (saveFile == nullptr || saveFile->err()) { delete saveFile; + error("Can not open savegame file for writing"); + return; } BladeRunner::SaveFileHeader header; -- cgit v1.2.3