mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 23:01:42 +00:00
IMAGE: Check the output surface bounds when writing QT encoded PICT images
This commit is contained in:
parent
f0f02c4a3f
commit
360e1e97c9
@ -577,9 +577,14 @@ void PICTDecoder::decodeCompressedQuickTime(Common::SeekableReadStream &stream)
|
||||
_outputSurface = new Graphics::Surface();
|
||||
_outputSurface->create(_imageRect.width(), _imageRect.height(), surface->format);
|
||||
}
|
||||
assert(_outputSurface->format == surface->format);
|
||||
|
||||
for (uint16 y = 0; y < surface->h; y++)
|
||||
memcpy(_outputSurface->getBasePtr(0 + xOffset, y + yOffset), surface->getBasePtr(0, y), surface->w * surface->format.bytesPerPixel);
|
||||
Common::Rect outputRect(surface->w, surface->h);
|
||||
outputRect.translate(xOffset, yOffset);
|
||||
outputRect.clip(_imageRect);
|
||||
|
||||
for (uint16 y = 0; y < outputRect.height(); y++)
|
||||
memcpy(_outputSurface->getBasePtr(outputRect.left, y + outputRect.top), surface->getBasePtr(0, y), outputRect.width() * surface->format.bytesPerPixel);
|
||||
|
||||
stream.seek(startPos + dataSize);
|
||||
delete codec;
|
||||
|
Loading…
x
Reference in New Issue
Block a user