[Scummvm-git-logs] scummvm master -> e82b4faeed26fdd153ac2b01d53771ba2b05e43f
sev-
sev at scummvm.org
Mon Aug 31 07:26:49 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:
e82b4faeed CINE: Fix overlay rendering with NULL source mask
Commit: e82b4faeed26fdd153ac2b01d53771ba2b05e43f
https://github.com/scummvm/scummvm/commit/e82b4faeed26fdd153ac2b01d53771ba2b05e43f
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2020-08-31T09:26:36+02: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