From c8b05f03ad31176ce8b6429c5d069f6800f29001 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 8 Jan 2017 22:52:19 -0600 Subject: SCI32: Fix invalid bitmap deletion in AVIPlayer --- engines/sci/graphics/video32.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 4af1e76ed9..f4eb2c2da0 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -140,6 +140,7 @@ AVIPlayer::AVIPlayer(SegManager *segMan, EventManager *eventMan) : _scaleBuffer(nullptr), _plane(nullptr), _screenItem(nullptr), + _bitmap(NULL_REG), _status(kAVINotOpen) {} AVIPlayer::~AVIPlayer() { @@ -327,8 +328,10 @@ AVIPlayer::IOStatus AVIPlayer::close() { _decoder->close(); _status = kAVINotOpen; - _segMan->freeBitmap(_bitmap); - _bitmap = NULL_REG; + if (_bitmap != NULL_REG) { + _segMan->freeBitmap(_bitmap); + _bitmap = NULL_REG; + } g_sci->_gfxFrameout->deletePlane(*_plane); _plane = nullptr; _screenItem = nullptr; -- cgit v1.2.3