[Scummvm-git-logs] scummvm master -> 438082b45420a563817cb0c2ea340910fd6b1064

Strangerke noreply at scummvm.org
Wed Jan 28 08:07:04 UTC 2026


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:
438082b454 M4: Fix CID 1532966


Commit: 438082b45420a563817cb0c2ea340910fd6b1064
    https://github.com/scummvm/scummvm/commit/438082b45420a563817cb0c2ea340910fd6b1064
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-01-28T09:06:55+01:00

Commit Message:
M4: Fix CID 1532966

Changed paths:
    engines/m4/gui/gui_item.cpp


diff --git a/engines/m4/gui/gui_item.cpp b/engines/m4/gui/gui_item.cpp
index ea76581a1cd..c1fe56a9b5b 100644
--- a/engines/m4/gui/gui_item.cpp
+++ b/engines/m4/gui/gui_item.cpp
@@ -190,21 +190,21 @@ bool sizeofGUIelement_interior(ButtonDrawRec *bdr, M4Rect *myRect) {
 }
 
 bool drawGUIelement(ButtonDrawRec *bdr, M4Rect *myRect) {
-	int32 topLeftColor, interiorColor, bottomRightColor, bottomLeftPix, topRightPix;
+	if (!bdr)
+		return false;
+
 	const int32 x1 = bdr->x1;
 	const int32 y1 = bdr->y1;
 	const int32 x2 = bdr->x2;
 	const int32 y2 = bdr->y2;
 	const bool pressed = bdr->pressed;
 
-	if (!bdr)
-		return false;
-
 	if (bdr->el_type == MESSAGE) {
 		sizeofGUIelement_interior(bdr, myRect);
 		return true;
 	}
 
+	int32 topLeftColor, interiorColor, bottomRightColor, bottomLeftPix, topRightPix;
 	if ((bdr->el_type == TEXTFIELD) || (bdr->el_type == LISTBOX)) {
 		if (!pressed) {
 			topLeftColor = __DKGRAY;
@@ -422,11 +422,10 @@ static int32 item_string_write(Buffer *target, char *myStr, int32 x, int32 y, in
 }
 
 static void CorrectItemWidthHeight(Item *item, int32 fontHeight) {
-	int32 tempWidth, tempHeight, minWidth, minHeight;
-
 	if (!item)
 		return;
 
+	int32 tempWidth, tempHeight, minWidth, minHeight;
 	switch (item->type) {
 	case LISTBOX:
 		minHeight = scrollUpHeight + thumbHeight + scrollDownHeight + _G(items).buttonHeight * 3;	//scrollup + thumb + scrolldown heights + (newHeight for each)




More information about the Scummvm-git-logs mailing list