[Scummvm-cvs-logs] scummvm master -> bdf14ed5985a318c3e07477d7bd108500e2c5043

clone2727 clone2727 at gmail.com
Mon Dec 19 21:23:33 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bdf14ed598 GRAPHICS: Fix PICT lines with large pitches


Commit: bdf14ed5985a318c3e07477d7bd108500e2c5043
    https://github.com/scummvm/scummvm/commit/bdf14ed5985a318c3e07477d7bd108500e2c5043
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-12-19T12:21:35-08:00

Commit Message:
GRAPHICS: Fix PICT lines with large pitches

Changed paths:
    graphics/pict.cpp



diff --git a/graphics/pict.cpp b/graphics/pict.cpp
index dcd0df8..ef26293 100644
--- a/graphics/pict.cpp
+++ b/graphics/pict.cpp
@@ -338,10 +338,9 @@ void PictDecoder::unpackBitsRect(Common::SeekableReadStream *stream, bool hasPal
 	_outputSurface = new Graphics::Surface();
 	_outputSurface->create(width, height, (bytesPerPixel == 1) ? PixelFormat::createFormatCLUT8() : _pixelFormat);
 
-	// Create an temporary buffer, but allocate a bit more than we need to avoid overflow
-	// (align it to the next highest two-byte packed boundary, which may be more unpacked,
-	// as m68k and therefore QuickDraw is word-aligned)
-	byte *buffer = new byte[width * height * bytesPerPixel + (8 * 2 / packBitsData.pixMap.pixelSize)];
+	// Ensure we have enough space in the buffer to hold an entire line's worth of pixels
+	uint32 lineSize = MAX<int>(width * bytesPerPixel + (8 * 2 / packBitsData.pixMap.pixelSize), packBitsData.pixMap.rowBytes);
+	byte *buffer = new byte[lineSize * height];
 
 	// Read in amount of data per row
 	for (uint16 i = 0; i < packBitsData.pixMap.bounds.height(); i++) {






More information about the Scummvm-git-logs mailing list