From 608cfc0149178dda87bd299be1d0ccc7fbd00961 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 16 Jan 2005 13:34:43 +0000 Subject: Fix for bug #1098872 (FTDEMO: Memoryleak in SMUSH player) svn-id: r16570 --- scumm/smush/smush_player.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scumm/smush') 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 -- cgit v1.2.3