aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2013-06-23 11:31:54 -0400
committerPaul Gilbert2013-06-23 11:31:54 -0400
commit2654135257bc6771a3e18794df15b0d8fc238647 (patch)
tree866fd4171b60b1d25c2a27fffba7aad3eeb68223 /engines
parentcc4486772c32f3ccc334541c8200e31375d78c78 (diff)
downloadscummvm-rg350-2654135257bc6771a3e18794df15b0d8fc238647.tar.gz
scummvm-rg350-2654135257bc6771a3e18794df15b0d8fc238647.tar.bz2
scummvm-rg350-2654135257bc6771a3e18794df15b0d8fc238647.zip
VOYEUR: Fix crash from using background resource after it's group is freed
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/animation.cpp2
-rw-r--r--engines/voyeur/graphics.cpp1
-rw-r--r--engines/voyeur/voyeur.cpp3
3 files changed, 4 insertions, 2 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp
index 7b5316b513..1f4e623976 100644
--- a/engines/voyeur/animation.cpp
+++ b/engines/voyeur/animation.cpp
@@ -329,7 +329,7 @@ RL2Decoder::RL2AudioTrack::~RL2AudioTrack() {
void RL2Decoder::RL2AudioTrack::queueSound(Common::SeekableReadStream *stream, int size) {
if (_audStream) {
// Queue the sound data
- byte *data = new byte[size];
+ byte *data = (byte *)malloc(size);
stream->read(data, size);
Common::MemoryReadStream *memoryStream = new Common::MemoryReadStream(data, size,
DisposeAfterUse::YES);
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index 98b3e74087..f517f1afa2 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -628,6 +628,7 @@ void GraphicsManager::setColor(int idx, byte r, byte g, byte b) {
void GraphicsManager::screenReset() {
resetPalette();
+
(*_vPort)->setupViewPort();
fillPic(*_vPort, 0);
(*_vPort)->_parent->_flags |= DISPFLAG_8;
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 75d97aa174..e7adc7d11b 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -427,10 +427,11 @@ void VoyeurEngine::showTitleScreen() {
_graphicsManager.screenReset();
_eventsManager.delay(200);
- _bVoy->freeBoltGroup(0x10500);
playRL2Video("a1100100.rl2");
_graphicsManager.screenReset();
+
+ _bVoy->freeBoltGroup(0x10500);
}
}