[Scummvm-git-logs] scummvm master -> ed93e09f92eb9012671d2d87bdbcdd843ed00b9b

aquadran noreply at scummvm.org
Mon Dec 20 18:42:55 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:
ed93e09f92 STARK: Fixed minority coverity warnings


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

Commit Message:
STARK: Fixed minority coverity warnings

Changed paths:
    graphics/tinygl/pixelbuffer.cpp
    graphics/tinygl/pixelbuffer.h
    graphics/tinygl/zdirtyrect.cpp


diff --git a/graphics/tinygl/pixelbuffer.cpp b/graphics/tinygl/pixelbuffer.cpp
index e315f636a4..46b2e483a7 100644
--- a/graphics/tinygl/pixelbuffer.cpp
+++ b/graphics/tinygl/pixelbuffer.cpp
@@ -82,7 +82,7 @@ void PixelBuffer::free() {
 	_buffer = NULL;
 }
 
-void PixelBuffer::clear(int length) {
+void PixelBuffer::clear(uint length) {
 	memset(_buffer, 0, length * _format.bytesPerPixel);
 }
 
diff --git a/graphics/tinygl/pixelbuffer.h b/graphics/tinygl/pixelbuffer.h
index 0bc725798f..06aec55a94 100644
--- a/graphics/tinygl/pixelbuffer.h
+++ b/graphics/tinygl/pixelbuffer.h
@@ -106,7 +106,7 @@ public:
 	 *
 	 * @param length The length of the buffer, in pixels.
 	 */
-	void clear(int length);
+	void clear(uint length);
 
 	/**
 	 * Set the value of the pixel at index 'pixel' to 'value',
diff --git a/graphics/tinygl/zdirtyrect.cpp b/graphics/tinygl/zdirtyrect.cpp
index 09f8d1b321..6f2cd012e0 100644
--- a/graphics/tinygl/zdirtyrect.cpp
+++ b/graphics/tinygl/zdirtyrect.cpp
@@ -62,7 +62,11 @@ struct DirtyRectangle {
 	Common::Rect rectangle;
 	int r, g, b;
 
-	DirtyRectangle() { }
+	DirtyRectangle() {
+		r = 0;
+		g = 0;
+		b = 0;
+	}
 	DirtyRectangle(Common::Rect rect, int red, int green, int blue) {
 		rectangle = rect;
 		r = red;
@@ -472,6 +476,8 @@ RasterizationDrawCall::RasterizationState RasterizationDrawCall::captureState()
 	state.lightingEnabled = c->lighting_enabled;
 	if (c->current_texture != nullptr)
 		state.textureVersion = c->current_texture->versionNumber;
+	else
+		state.textureVersion = 0;
 
 	memcpy(state.viewportScaling, c->viewport.scale._v, sizeof(c->viewport.scale._v));
 	memcpy(state.viewportTranslation, c->viewport.trans._v, sizeof(c->viewport.trans._v));




More information about the Scummvm-git-logs mailing list