aboutsummaryrefslogtreecommitdiff
path: root/engines/cge
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-03 15:41:07 +1000
committerPaul Gilbert2011-07-03 15:41:07 +1000
commitd53142d95e793861d2891f8a7d16ac11b9b94126 (patch)
treed01ab4b23f3e347efb1f8d3d1e8812293aea9b09 /engines/cge
parent900e8cbf5b95ceea36c44296bc0de12e32687745 (diff)
downloadscummvm-rg350-d53142d95e793861d2891f8a7d16ac11b9b94126.tar.gz
scummvm-rg350-d53142d95e793861d2891f8a7d16ac11b9b94126.tar.bz2
scummvm-rg350-d53142d95e793861d2891f8a7d16ac11b9b94126.zip
CGE: Fixed code using memory overruns to do duplication
Diffstat (limited to 'engines/cge')
-rw-r--r--engines/cge/bitmap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index c94b8503cf..833d0f1f1b 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -117,6 +117,11 @@ Bitmap::Bitmap(uint16 w, uint16 h, uint8 fill)
HideDesc *b = (HideDesc *)(v + 4 * psiz);
b->skip = (SCR_WID - _w) >> 2;
b->hide = _w >> 2;
+
+ // Replicate across the entire table
+ for (HideDesc *hdP = b + 1; hdP < (b + _h); ++hdP)
+ *hdP = *b;
+
memcpy(b + 1, b, (_h - 1) * sizeof(*b)); // tricky fill entire table
b->skip = 0; // fix the first entry
_v = v;