aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Millstone2007-07-02 22:42:35 +0000
committerNeil Millstone2007-07-02 22:42:35 +0000
commitc43f68e5540923d04504f1ab3e4c967e04ae6257 (patch)
treeaed21fd845e17300122f60c3545efd8f79449817
parentfddc9fb3f605863ef39e933996d06f7c14ba61be (diff)
downloadscummvm-rg350-c43f68e5540923d04504f1ab3e4c967e04ae6257.tar.gz
scummvm-rg350-c43f68e5540923d04504f1ab3e4c967e04ae6257.tar.bz2
scummvm-rg350-c43f68e5540923d04504f1ab3e4c967e04ae6257.zip
Fix bug where an object was accessed after it was deleted in cine engine
svn-id: r27870
-rw-r--r--engines/cine/various.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 281c4807b8..49b10b6b14 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -2458,6 +2458,7 @@ void drawFailureMessage(byte cmd) {
void drawOverlays(void) {
overlayHeadElement *currentOverlay;
+ overlayHeadElement *nextOverlay;
backupOverlayPage();
@@ -2468,6 +2469,8 @@ void drawOverlays(void) {
currentOverlay = currentOverlay->next;
while (currentOverlay) {
+ nextOverlay = currentOverlay->next;
+
switch (currentOverlay->type) {
case 0: // sprite
{
@@ -2630,7 +2633,7 @@ void drawOverlays(void) {
}
}
- currentOverlay = currentOverlay->next;
+ currentOverlay = nextOverlay;
}
}