[Scummvm-git-logs] scummvm master -> 50f9fa3df681afdc8dad15484db9115383488eb8

aquadran noreply at scummvm.org
Mon Dec 20 18:22:43 UTC 2021


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

Summary:
50f9fa3df6 STARK: Fixed minor coverity warnings


Commit: 50f9fa3df681afdc8dad15484db9115383488eb8
    https://github.com/scummvm/scummvm/commit/50f9fa3df681afdc8dad15484db9115383488eb8
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-20T19:22:39+01:00

Commit Message:
STARK: Fixed minor coverity warnings

Changed paths:
    engines/stark/formats/iss.cpp
    engines/stark/gfx/tinyglbitmap.cpp
    engines/stark/resources/image.cpp
    engines/stark/stark.cpp
    engines/stark/ui/menu/fmvmenu.cpp


diff --git a/engines/stark/formats/iss.cpp b/engines/stark/formats/iss.cpp
index 0d263b7e42..6143695cc2 100644
--- a/engines/stark/formats/iss.cpp
+++ b/engines/stark/formats/iss.cpp
@@ -83,7 +83,7 @@ static Common::String readString(Common::SeekableReadStream *stream) {
 
 Audio::RewindableAudioStream *makeISSStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse) {
 	Common::String codec;
-	uint16 blockSize, channels, freq;
+	uint16 blockSize, channels, freq = 44100;
 	uint32 size;
 	byte flags;
 
@@ -107,7 +107,9 @@ Audio::RewindableAudioStream *makeISSStream(Common::SeekableReadStream *stream,
 		// ?
 
 		codec = readString(stream);
-		freq = 44100 / (uint16)strtol(codec.c_str(), 0, 10);
+		int val = strtol(codec.c_str(), 0, 10);
+		if (val)
+			freq /= val;
 
 		skipString(stream);
 
@@ -132,7 +134,9 @@ Audio::RewindableAudioStream *makeISSStream(Common::SeekableReadStream *stream,
 		// ?
 
 		codec = readString(stream);
-		freq = 44100 / (uint16)strtol(codec.c_str(), 0, 10);
+		int val = strtol(codec.c_str(), 0, 10);
+		if (val)
+			freq /= val;
 
 		skipString(stream);
 
diff --git a/engines/stark/gfx/tinyglbitmap.cpp b/engines/stark/gfx/tinyglbitmap.cpp
index f033d579e5..4a91c3fd82 100644
--- a/engines/stark/gfx/tinyglbitmap.cpp
+++ b/engines/stark/gfx/tinyglbitmap.cpp
@@ -29,7 +29,8 @@ namespace Stark {
 namespace Gfx {
 
 TinyGlBitmap::TinyGlBitmap() :
-	Texture() {
+		Texture(),
+		 _texture1x1Color(0) {
 	_blitImage = tglGenBlitImage();
 }
 
diff --git a/engines/stark/resources/image.cpp b/engines/stark/resources/image.cpp
index 34a01d197c..db4e70ca09 100644
--- a/engines/stark/resources/image.cpp
+++ b/engines/stark/resources/image.cpp
@@ -277,7 +277,7 @@ void ImageText::readData(Formats::XRCReadStream *stream) {
 	_color.r = stream->readByte();
 	_color.g = stream->readByte();
 	_color.b = stream->readByte();
-	_color.a = stream->readByte() | 0xFF;
+	_color.a = 0xFF; stream->readByte();
 	_font = stream->readUint32LE();
 
 	// WORKAROUND: Give more space to text in the Archives' computer
diff --git a/engines/stark/stark.cpp b/engines/stark/stark.cpp
index 3f0252b75c..684cead78b 100644
--- a/engines/stark/stark.cpp
+++ b/engines/stark/stark.cpp
@@ -266,7 +266,8 @@ void StarkEngine::addModsToSearchPath() const {
 	const Common::FSNode modsDir = gameDataDir.getChild("mods");
 	if (modsDir.exists()) {
 		Common::FSList list;
-		modsDir.getChildren(list);
+		if (!modsDir.getChildren(list))
+			return;
 
 		Common::sort(list.begin(), list.end(), modsCompare);
 
diff --git a/engines/stark/ui/menu/fmvmenu.cpp b/engines/stark/ui/menu/fmvmenu.cpp
index c066fcf335..71358f60ef 100644
--- a/engines/stark/ui/menu/fmvmenu.cpp
+++ b/engines/stark/ui/menu/fmvmenu.cpp
@@ -32,7 +32,9 @@ namespace Stark {
 
 FMVMenuScreen::FMVMenuScreen(Gfx::Driver *gfx, Cursor *cursor) :
 		StaticLocationScreen(gfx, cursor, "DiaryFMV", Screen::kScreenFMVMenu),
-		_fmvWidgets() {
+		_fmvWidgets(),
+		_page(0),
+		_maxPage(0) {
 	_formatRectPos = Common::Point(202, 61);
 	_fontHeight = 16;
 	_fmvPerPage = 18;




More information about the Scummvm-git-logs mailing list