aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cpp
diff options
context:
space:
mode:
authorColin Snover2016-07-30 10:55:00 -0500
committerColin Snover2016-08-01 10:37:14 -0500
commit6d1f8e8c876983f22e94ba8966b02d8cc088d2a5 (patch)
treeccb48906190637eb0fc197951009041237e7633e /engines/sci/engine/savegame.cpp
parent10f9cb7023e2f68d5489b6f73b46a6e541f86b72 (diff)
downloadscummvm-rg350-6d1f8e8c876983f22e94ba8966b02d8cc088d2a5.tar.gz
scummvm-rg350-6d1f8e8c876983f22e94ba8966b02d8cc088d2a5.tar.bz2
scummvm-rg350-6d1f8e8c876983f22e94ba8966b02d8cc088d2a5.zip
SCI32: Fix invalid memory access after BitmapTable is extended
When new bitmaps are added and the underlying Common::Array needs to move to expand, this invalidates all pointers to bitmaps, which makes it basically impossible to use the bitmap segment since you never know if a reference is going to be invalidated due to an array move. To solve this, BitmapTable is changed to hold pointers to SciBitmaps that are allocated separately on the heap instead, so when those bitmaps are looked up, the resulting pointers are valid for the lifetime of the bitmap, instead of the lifetime of the Common::Array used internally by BitmapTable.
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r--engines/sci/engine/savegame.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index f49853de2f..62f9c5aada 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -159,7 +159,7 @@ void syncWithSerializer(Common::Serializer &s, SciString &obj) {
}
}
-void syncWithSerializer(Common::Serializer &s, SciBitmap &obj) {
+void syncWithSerializer(Common::Serializer &s, SciBitmap *obj) {
debug("TODO: Sync bitmap");
// if (s.isSaving()) {