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

mduggan noreply at scummvm.org
Sat Dec 9 23:18:56 UTC 2023


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

Summary:
0b4aa788ff GRAPHICS: Correct cleanup loop on BDF load failure
48ff3a6c92 ULTIMA: NUVIE: Fix memory leak on script load failure
90f9aaaadb ULTIMA8: Fix unused variable warning
ac3131ecb4 ULTIMA8: Fix possible uninitialized variable use
841857faee ULTIMA: NUVIE: Fix screen update rect size
d8c297b2d9 ULTIMA: NUVIE: Fix memory leak on character morph


Commit: 0b4aa788ff63971fdb10363c708b416132ca9120
    https://github.com/scummvm/scummvm/commit/0b4aa788ff63971fdb10363c708b416132ca9120
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:04:30+11:00

Commit Message:
GRAPHICS: Correct cleanup loop on BDF load failure

Identified by xcode analysis, the cleanup code would have crashed before as it
was using the wrong loop variable.

Changed paths:
    graphics/fonts/bdf.cpp


diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index cb77d3688b5..0acac2701fc 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -679,7 +679,7 @@ BdfFont *BdfFont::loadFromCache(Common::SeekableReadStream &stream) {
 
 		if (stream.err() || stream.eos()) {
 			for (int j = 0; j < i; ++j)
-				delete[] bitmaps[i];
+				delete[] bitmaps[j];
 			delete[] bitmaps;
 			return nullptr;
 		}


Commit: 48ff3a6c929a9e2d386e543a769a41188e394198
    https://github.com/scummvm/scummvm/commit/48ff3a6c929a9e2d386e543a769a41188e394198
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:04:30+11:00

Commit Message:
ULTIMA: NUVIE: Fix memory leak on script load failure

Changed paths:
    engines/ultima/nuvie/core/converse.cpp


diff --git a/engines/ultima/nuvie/core/converse.cpp b/engines/ultima/nuvie/core/converse.cpp
index a4f7ba31472..815e6088262 100644
--- a/engines/ultima/nuvie/core/converse.cpp
+++ b/engines/ultima/nuvie/core/converse.cpp
@@ -493,8 +493,10 @@ const char *Converse::npc_name(uint8 num) {
 		num = load_conv(get_script_num(num)); // get idx number; won't actually reload file
 		temp_script = new ConvScript(src, num);
 		s_pt = temp_script->get_buffer();
-		if (!s_pt)
+		if (!s_pt) {
+			delete temp_script;
 			return nullptr;
+		}
 
 		// read name up to LOOK section, convert "_" to "."
 		uint32 c;


Commit: 90f9aaaadb74c2a1d9039c3bdbf2191522c3f301
    https://github.com/scummvm/scummvm/commit/90f9aaaadb74c2a1d9039c3bdbf2191522c3f301
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:04:30+11:00

Commit Message:
ULTIMA8: Fix unused variable warning

Changed paths:
    engines/ultima/ultima8/ultima8.cpp


diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 5f90bee6e1c..7c66d48ff9d 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -783,8 +783,8 @@ void Ultima8Engine::GraphicSysInit() {
 }
 
 void Ultima8Engine::changeVideoMode(int width, int height) {
-	if (width > 0) width = ConfMan.getInt("width");
-	if (height > 0) height = ConfMan.getInt("height");
+	//if (width > 0) width = ConfMan.getInt("width");
+	//if (height > 0) height = ConfMan.getInt("height");
 
 	GraphicSysInit();
 }


Commit: ac3131ecb417954ceb88b19ed0f5e69408bf255d
    https://github.com/scummvm/scummvm/commit/ac3131ecb417954ceb88b19ed0f5e69408bf255d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:04:30+11:00

Commit Message:
ULTIMA8: Fix possible uninitialized variable use

Identified by xcode flow analysis - if the treasure data was bad, it's possible
for the max/min count to be left uninitialized.

Changed paths:
    engines/ultima/ultima8/games/treasure_loader.cpp


diff --git a/engines/ultima/ultima8/games/treasure_loader.cpp b/engines/ultima/ultima8/games/treasure_loader.cpp
index f8e361a144d..f5a93f79bf6 100644
--- a/engines/ultima/ultima8/games/treasure_loader.cpp
+++ b/engines/ultima/ultima8/games/treasure_loader.cpp
@@ -207,9 +207,10 @@ bool TreasureLoader::parseUIntRange(const Std::string &val,
 		return false;
 	int t1, t2;
 	bool ok = true;
-	ok &= parseInt(val.substr(0, pos), t1);
-	ok &= parseInt(val.substr(pos + 1), t2);
-	if (ok && t1 <= t2 && t1 >= 0 && t2 >= 0) {
+	ok = ok && parseInt(val.substr(0, pos), t1);
+	ok = ok && parseInt(val.substr(pos + 1), t2);
+	ok = ok && (t1 <= t2 && t1 >= 0 && t2 >= 0);
+	if (ok) {
 		min = t1;
 		max = t2;
 	}


Commit: 841857faee2373da3b179acadcacaaded673b05d
    https://github.com/scummvm/scummvm/commit/841857faee2373da3b179acadcacaaded673b05d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:18:19+11:00

Commit Message:
ULTIMA: NUVIE: Fix screen update rect size

Changed paths:
    engines/ultima/nuvie/screen/screen.cpp


diff --git a/engines/ultima/nuvie/screen/screen.cpp b/engines/ultima/nuvie/screen/screen.cpp
index 5de8d3a5dff..76108d75589 100644
--- a/engines/ultima/nuvie/screen/screen.cpp
+++ b/engines/ultima/nuvie/screen/screen.cpp
@@ -1078,7 +1078,7 @@ void Screen::update(int x, int y, uint16 w, uint16 h) {
 		h = height - y;
 
 	// Get the subarea, which internally adds a dirty rect for the given area
-	_rawSurface->getSubArea(Common::Rect(x, y, x + width, y + height));
+	_rawSurface->getSubArea(Common::Rect(x, y, x + w, y + h));
 }
 
 void Screen::performUpdate() {


Commit: d8c297b2d906e0e87c1a71eaf308f8e6e00c0db2
    https://github.com/scummvm/scummvm/commit/d8c297b2d906e0e87c1a71eaf308f8e6e00c0db2
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-12-10T10:18:37+11:00

Commit Message:
ULTIMA: NUVIE: Fix memory leak on character morph

Changed paths:
    engines/ultima/nuvie/actors/actor.cpp


diff --git a/engines/ultima/nuvie/actors/actor.cpp b/engines/ultima/nuvie/actors/actor.cpp
index 8e25d03b6d7..9397a5857ca 100644
--- a/engines/ultima/nuvie/actors/actor.cpp
+++ b/engines/ultima/nuvie/actors/actor.cpp
@@ -1881,6 +1881,7 @@ bool Actor::morph(uint16 objN) {
 	actor_obj->obj_n = objN;
 	actor_obj->frame_n = 0;
 	init_from_obj(actor_obj);
+	delete actor_obj;
 	set_dead_flag(false);
 	set_direction(old_dir); // FIXME: this should get saved through init_from_obj()
 	return true;




More information about the Scummvm-git-logs mailing list