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

sev- sev at scummvm.org
Sun Sep 29 17:40:53 CEST 2019


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

Summary:
f7262a4e43 GRAPHICS: Added more debug output to 9-patch
25159714fb GRAPHICS: Allow 256-byte palettes to 9-patch
ffc4b685e3 GRAPHICS: MACGUI: Fixed stack smashing


Commit: f7262a4e43dc8b6fde2afe7272053260a7aaa2a3
    https://github.com/scummvm/scummvm/commit/f7262a4e43dc8b6fde2afe7272053260a7aaa2a3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-29T17:39:44+02:00

Commit Message:
GRAPHICS: Added more debug output to 9-patch

Changed paths:
    graphics/nine_patch.cpp


diff --git a/graphics/nine_patch.cpp b/graphics/nine_patch.cpp
index 4545750..ece1ff1 100644
--- a/graphics/nine_patch.cpp
+++ b/graphics/nine_patch.cpp
@@ -73,14 +73,16 @@ bool NinePatchSide::init(Graphics::TransparentSurface *bmp, bool vertical) {
 		uint32 *color = vertical ? (uint32 *)bmp->getBasePtr(0, i) : (uint32 *)bmp->getBasePtr(i, 0);
 		bmp->format.colorToARGB(*color, a, r, g, b);
 
-		if (i == len - 1)
+		if (i == len - 1) {
 			zz = -1;
-		else if (r == 0 && g == 0 && b == 0 && a == 255)
+		} else if (r == 0 && g == 0 && b == 0 && a == 255) {
 			zz = 0;
-		else if (a == 0 || r + g + b + a == 255 * 4)
+		} else if (a == 0 || r + g + b + a == 255 * 4) {
 			zz = 1;
-		else
+		} else {
+			warning("NinePatchSide::init(): Bad pixel at %d,%d", (vertical ? 0 : i), (vertical ? i : 0));
 			return false;
+		}
 
 		if (z != zz) {
 			if (s != -1) {
@@ -198,6 +200,8 @@ NinePatchBitmap::NinePatchBitmap(Graphics::TransparentSurface *bmp, bool owns_bi
 
 	if (!_h.init(bmp, false) || !_v.init(bmp, true)) {
 bad_bitmap:
+		warning("NinePatchBitmap::NinePatchBitmap(): Bad bitmap");
+
 		_h._m.clear();
 		_v._m.clear();
 	}


Commit: 25159714fb529b2d6c0785a545d569cb61e31390
    https://github.com/scummvm/scummvm/commit/25159714fb529b2d6c0785a545d569cb61e31390
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-29T17:40:12+02:00

Commit Message:
GRAPHICS: Allow 256-byte palettes to 9-patch

Changed paths:
    graphics/nine_patch.cpp


diff --git a/graphics/nine_patch.cpp b/graphics/nine_patch.cpp
index ece1ff1..fc1999d 100644
--- a/graphics/nine_patch.cpp
+++ b/graphics/nine_patch.cpp
@@ -356,7 +356,7 @@ byte NinePatchBitmap::closestGrayscale(uint32 color, byte* palette, int paletteL
 		byte target = grayscale(color);
 		byte bestNdx = 0;
 		byte bestColor = grayscale(palette[0], palette[1], palette[2]);
-		for (byte i = 1; i < paletteLength; ++i) {
+		for (int i = 1; i < paletteLength; ++i) {
 			byte current = grayscale(palette[i * 3], palette[(i * 3) + 1], palette[(i * 3) + 2]);
 			if (dist(target, bestColor) >= dist(target, current)) {
 				bestColor = current;


Commit: ffc4b685e30d9523bd0fa1385e9fcf02d94861ef
    https://github.com/scummvm/scummvm/commit/ffc4b685e30d9523bd0fa1385e9fcf02d94861ef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-09-29T17:40:33+02:00

Commit Message:
GRAPHICS: MACGUI: Fixed stack smashing

Changed paths:
    graphics/macgui/macwindowborder.cpp


diff --git a/graphics/macgui/macwindowborder.cpp b/graphics/macgui/macwindowborder.cpp
index f11fbdd..7dae697 100644
--- a/graphics/macgui/macwindowborder.cpp
+++ b/graphics/macgui/macwindowborder.cpp
@@ -91,7 +91,7 @@ void MacWindowBorder::blitBorderInto(ManagedSurface &destination, bool active) {
 	srf.create(destination.w, destination.h, destination.format);
 	srf.fillRect(Common::Rect(srf.w, srf.h), kColorGreen2);
 
-	byte palette[kColorCount];
+	byte palette[kColorCount * 3];
 	g_system->getPaletteManager()->grabPalette(palette, 0, kColorCount);
 
 	src->blit(srf, 0, 0, srf.w, srf.h, palette, kColorCount);





More information about the Scummvm-git-logs mailing list