mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 09:18:38 +00:00
GRAPHICS: Fix PICT buffer overflow
This commit is contained in:
parent
6a54c7953a
commit
3f0c9e0910
@ -337,7 +337,11 @@ void PictDecoder::unpackBitsRect(Common::SeekableReadStream *stream, bool hasPal
|
||||
|
||||
_outputSurface = new Graphics::Surface();
|
||||
_outputSurface->create(width, height, (bytesPerPixel == 1) ? PixelFormat::createFormatCLUT8() : _pixelFormat);
|
||||
byte *buffer = new byte[width * height * bytesPerPixel];
|
||||
|
||||
// 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)];
|
||||
|
||||
// Read in amount of data per row
|
||||
for (uint16 i = 0; i < packBitsData.pixMap.bounds.height(); i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user