diff --git a/engines/asylum/system/graphics.cpp b/engines/asylum/system/graphics.cpp index d3f7955833d..71f5bb9fcb5 100644 --- a/engines/asylum/system/graphics.cpp +++ b/engines/asylum/system/graphics.cpp @@ -57,7 +57,7 @@ bool GraphicResource::load(ResourceId id) { void GraphicResource::clear() { for (uint32 i = 0; i < _frames.size(); i++) { - _frames[i].surface.free(); + delete[] (byte*)_frames[i].surface.getPixels(); } _frames.clear(); @@ -141,7 +141,7 @@ void GraphicResource::init(byte *data, int32 size) { uint16 width = READ_LE_UINT16(dataPtr); dataPtr += 2; - _frames[i].surface.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); + _frames[i].surface.init(width, height, width, new byte[width * height], Graphics::PixelFormat::createFormatCLUT8()); memcpy(_frames[i].surface.getPixels(), dataPtr, (size_t)(width * height)); }