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

Strangerke noreply at scummvm.org
Wed Jun 25 22:41:18 UTC 2025


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:
abc76c7276 M4: Fix Coverity SID 1532938 & 1532908


Commit: abc76c72764cfa7685a08d877951cb1cc90ad8e6
    https://github.com/scummvm/scummvm/commit/abc76c72764cfa7685a08d877951cb1cc90ad8e6
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-06-25T23:40:08+01:00

Commit Message:
M4: Fix Coverity SID 1532938 & 1532908

Changed paths:
    engines/m4/graphics/krn_pal.h
    engines/m4/wscript/ws_hal.cpp


diff --git a/engines/m4/graphics/krn_pal.h b/engines/m4/graphics/krn_pal.h
index 288336db789..9aa093b332f 100644
--- a/engines/m4/graphics/krn_pal.h
+++ b/engines/m4/graphics/krn_pal.h
@@ -68,7 +68,7 @@ struct KernelPal_Globals {
 	RGB8 *_picPal = nullptr;
 	int32 _seriesHash = 0;
 	machine *_seriesAnim8 = nullptr;
-	uint8 _translation[38];		// Only 32 greys in ramp for Orion, 38 for Riddle
+	uint8 _translation[64];
 
 	int32 _colorAreaX1 = -1;
 	int32 _colorAreaY1 = -1;
diff --git a/engines/m4/wscript/ws_hal.cpp b/engines/m4/wscript/ws_hal.cpp
index ed120ccf9df..5c37f320890 100644
--- a/engines/m4/wscript/ws_hal.cpp
+++ b/engines/m4/wscript/ws_hal.cpp
@@ -186,8 +186,11 @@ static void drawSprite(CCB *myCCB, Anim8 *myAnim8, Buffer *halScrnBuf, Buffer *s
 
 void ws_DoDisplay(Buffer *background, int16 *depth_table, Buffer *screenCodeBuff,
 		uint8 *myPalette, uint8 *ICT, bool updateVideo) {
+
+	if (!background)
+		error("ws_DoDisplay : background not set");
+
 	CCB *myCCB;
-	ScreenContext *myScreen;
 	RectList *myRect;
 	RectList *drawRectList;
 	int32 status;
@@ -195,7 +198,8 @@ void ws_DoDisplay(Buffer *background, int16 *depth_table, Buffer *screenCodeBuff
 	M4Rect *currRect;
 	bool breakFlag;
 
-	if (((myScreen = vmng_screen_find(_G(gameDrawBuff), &status)) == nullptr) || (status != SCRN_ACTIVE)) {
+	ScreenContext *myScreen = vmng_screen_find(_G(gameDrawBuff), &status);
+	if ((myScreen == nullptr) || (status != SCRN_ACTIVE)) {
 		return;
 	}
 
@@ -239,7 +243,7 @@ void ws_DoDisplay(Buffer *background, int16 *depth_table, Buffer *screenCodeBuff
 
 	// The drawRectList now contains all the areas of the screen that need the background updated
 	// Update the background behind the current rect list - if we are in greyMode, we do this later
-	if (!greyMode && background && background->data) {
+	if (!greyMode && background->data) {
 		myRect = drawRectList;
 
 		while (myRect) {
@@ -310,7 +314,7 @@ void ws_DoDisplay(Buffer *background, int16 *depth_table, Buffer *screenCodeBuff
 	} while (!breakFlag);
 
 	// Handle update background rect area
-	if (greyMode && background && background->data) {
+	if (greyMode && background->data) {
 		myRect = drawRectList;
 
 		while (myRect) {
@@ -364,7 +368,7 @@ void ws_hal_RefreshWoodscriptBuffer(cruncher *myCruncher, Buffer *background,
 	Buffer drawSpriteBuff;
 	DrawRequest spriteDrawReq;
 
-	if ((!background) || (!background->data))
+	if (!background || !background->data)
 		return;
 
 	term_message("Refresh");




More information about the Scummvm-git-logs mailing list