diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 253ce44..5f7aa9d 100644
a
|
b
|
static void sync_menubar_t(Common::Serializer &s, menubar_t &obj) {
|
134 | 134 | } |
135 | 135 | |
136 | 136 | static void sync_SegManager(Common::Serializer &s, SegManager &obj) { |
| 137 | int allocated_heap_size = obj.heap_size; |
137 | 138 | s.syncAsSint32LE(obj.heap_size); |
138 | 139 | s.syncAsSint32LE(obj.reserved_id); |
139 | 140 | s.syncAsSint32LE(obj.exports_wide); |
… |
… |
static void sync_SegManager(Common::Serializer &s, SegManager &obj) {
|
143 | 144 | sync_IntMapper(s, *obj.id_seg_map); |
144 | 145 | |
145 | 146 | assert(obj.heap); |
| 147 | if (allocated_heap_size != obj.heap_size) |
| 148 | obj.heap = (MemObject**)sci_realloc((void *)obj.heap, obj.heap_size * sizeof(MemObject *)); |
| 149 | |
146 | 150 | for (int i = 0; i < obj.heap_size; ++i) |
147 | 151 | sync_MemObjPtr(s, obj.heap[i]); |
148 | 152 | |