From 3b5236c9dee1a14c231b5622582eb9bc87b897a3 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 31 May 2016 13:25:38 +0200 Subject: IMAGE: Init memory before usage --- image/pict.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/image/pict.cpp b/image/pict.cpp index 89f115dc90..4f4f0396bf 100644 --- a/image/pict.cpp +++ b/image/pict.cpp @@ -340,6 +340,8 @@ void PICTDecoder::unpackBitsRect(Common::SeekableReadStream &stream, bool withPa uint32 lineSize = MAX(width * bytesPerPixel + (8 * 2 / packBitsData.pixMap.pixelSize), packBitsData.pixMap.rowBytes); byte *buffer = new byte[lineSize * height]; + memset(buffer, 0, lineSize * height); + // Read in amount of data per row for (uint16 i = 0; i < packBitsData.pixMap.bounds.height(); i++) { // NOTE: Compression 0 is "default". The format in SCI games is packed when 0. -- cgit v1.2.3