[Scummvm-git-logs] scummvm branch-2-2 -> 5501bea8a7bbfc2912b513b907a00faf59a97d74

bluegr bluegr at gmail.com
Mon Aug 31 04:56:34 UTC 2020


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:
5501bea8a7 CINE: Fix overlay rendering with NULL source mask


Commit: 5501bea8a7bbfc2912b513b907a00faf59a97d74
    https://github.com/scummvm/scummvm/commit/5501bea8a7bbfc2912b513b907a00faf59a97d74
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2020-08-31T07:56:31+03:00

Commit Message:
CINE: Fix overlay rendering with NULL source mask

In French Amiga Future Wars from bug #10643 when walking left from the
scene with the open manhole cover a call to renderOverlay with a
type 0 (color sprite) overlay happens. The source mask for the overlay
is NULL and a memcpy using a NULL pointer as source is initiated.
This results in a memory access violation.

This fixes that memory access violation by simply setting the
destination mask to all zeroes when the source mask is NULL.
Seems to work fine at least in this case.

Fixes bug #10643.

Changed paths:
    engines/cine/gfx.cpp


diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index fb6876bc6b..c7a30f7d32 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -653,7 +653,14 @@ void FWRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
 		sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
 		len = sprite->_realWidth * sprite->_height;
 		mask = new byte[len];
-		memcpy(mask, sprite->mask(), len);
+		if (sprite->mask() != NULL) {
+			memcpy(mask, sprite->mask(), len);
+		} else {
+			// This case happens in French Amiga Future Wars (Bug #10643) when
+			// walking left from the scene with the open manhole cover. This
+			// seems to work fine at least in this case.
+			memset(mask, 0, len);
+		}
 		remaskSprite(mask, it);
 		drawMaskedSprite(g_cine->_objectTable[it->objIdx], mask);
 		delete[] mask;




More information about the Scummvm-git-logs mailing list