[Scummvm-git-logs] scummvm master -> 0da806b04befdfa2edc3debbfb3b4531c93eb5af

lephilousophe noreply at scummvm.org
Sun Oct 23 15:35:44 UTC 2022


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:
0da806b04b ICB: Fix CID 1433477, 1433308 and 1433637


Commit: 0da806b04befdfa2edc3debbfb3b4531c93eb5af
    https://github.com/scummvm/scummvm/commit/0da806b04befdfa2edc3debbfb3b4531c93eb5af
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-10-23T17:32:37+02:00

Commit Message:
ICB: Fix CID 1433477, 1433308 and 1433637

Changed paths:
    engines/icb/stagedraw_pc_poly.cpp
    engines/icb/text_pc.cpp


diff --git a/engines/icb/stagedraw_pc_poly.cpp b/engines/icb/stagedraw_pc_poly.cpp
index 2b1dd13ff86..8addc4e4e31 100644
--- a/engines/icb/stagedraw_pc_poly.cpp
+++ b/engines/icb/stagedraw_pc_poly.cpp
@@ -616,7 +616,7 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
 	}
 
 	uint32 nl = set->GetPRig()->nLamps;
-	if ((nl == 0) || (nl > MAX_NUMBER_LIGHTS)) {
+	if ((nl == 0) || (nl >= MAX_NUMBER_LIGHTS)) {
 		Fatal_error("Illegal number of lights %d in rlp file", nl);
 	}
 
diff --git a/engines/icb/text_pc.cpp b/engines/icb/text_pc.cpp
index d4856e7249c..194a5e3fed7 100644
--- a/engines/icb/text_pc.cpp
+++ b/engines/icb/text_pc.cpp
@@ -50,6 +50,7 @@ void Clip_text_print(_rgb *pen, uint32 x, uint32 y, uint8 *base, uint32 pitch, c
 
 	va_start(arg_ptr, format);
 	vsnprintf(ascii, 150, format, arg_ptr);
+	va_end(arg_ptr);
 
 	pxString font_cluster = FONT_CLUSTER_PATH;
 	charSet = rs_font->Res_open(SYS_FONT, sys_font_hash, font_cluster, font_cluster_hash);
@@ -66,7 +67,7 @@ void Clip_text_print(_rgb *pen, uint32 x, uint32 y, uint8 *base, uint32 pitch, c
 
 		x += FROM_LE_16(head->width) + 1; // move on the x coordinate
 
-	} while ((ascii[j]) && j < 150);
+	} while (j < 150 && ascii[j]);
 }
 
 void Render_clip_character(int32 x, int32 y, uint32 width, uint32 height, _rgb *pen, uint8 *ad, uint32 pitch, uint8 *sprite_data_ad) {




More information about the Scummvm-git-logs mailing list