aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorMax Horn2005-01-16 13:34:43 +0000
committerMax Horn2005-01-16 13:34:43 +0000
commit608cfc0149178dda87bd299be1d0ccc7fbd00961 (patch)
treed934516beb148d98aaccbd7be4b829579b0992dc /scumm/smush
parentd541535ab6cdb38f8d6efba68411477adec136f5 (diff)
downloadscummvm-rg350-608cfc0149178dda87bd299be1d0ccc7fbd00961.tar.gz
scummvm-rg350-608cfc0149178dda87bd299be1d0ccc7fbd00961.tar.bz2
scummvm-rg350-608cfc0149178dda87bd299be1d0ccc7fbd00961.zip
Fix for bug #1098872 (FTDEMO: Memoryleak in SMUSH player)
svn-id: r16570
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/smush_player.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 0076c287a9..95982f83c4 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -748,7 +748,9 @@ void SmushPlayer::handleZlibFrameObject(Chunk &b) {
int height = READ_LE_UINT16(ptr); ptr += 2;
if ((height == 242) && (width == 384)) {
- _dst = _specialBuffer = (byte *)malloc(242 * 384);
+ if (_specialBuffer == 0)
+ _specialBuffer = (byte *)malloc(242 * 384);
+ _dst = _specialBuffer;
} else if ((height > _vm->_screenHeight) || (width > _vm->_screenWidth))
return;
// FT Insane uses smaller frames to draw overlays with moving objects
@@ -812,7 +814,9 @@ void SmushPlayer::handleFrameObject(Chunk &b) {
int height = b.getWord();
if ((height == 242) && (width == 384)) {
- _dst = _specialBuffer = (byte *)malloc(242 * 384);
+ if (_specialBuffer == 0)
+ _specialBuffer = (byte *)malloc(242 * 384);
+ _dst = _specialBuffer;
} else if ((height > _vm->_screenHeight) || (width > _vm->_screenWidth))
return;
// FT Insane uses smaller frames to draw overlays with moving objects