GRAPHICS: Fix memory overrun blitting from paletted surfaces
This commit is contained in:
parent
0f96d7b776
commit
bb405565b7
1 changed files with 4 additions and 4 deletions
|
@ -244,8 +244,7 @@ void ManagedSurface::blitFromInner(const Surface &src, const Common::Rect &srcRe
|
|||
for (int x = 0; x < srcBounds.width(); ++x,
|
||||
srcP += src.format.bytesPerPixel,
|
||||
destP += format.bytesPerPixel) {
|
||||
src.format.colorToARGB(src.format.bytesPerPixel == 2 ? *(const uint16 *)srcP : *(const uint32 *)srcP,
|
||||
aSrc, rSrc, gSrc, bSrc);
|
||||
|
||||
if (src.format.bytesPerPixel == 1) {
|
||||
// Get the palette color
|
||||
const uint32 col = palette[*srcP];
|
||||
|
@ -255,8 +254,9 @@ void ManagedSurface::blitFromInner(const Surface &src, const Common::Rect &srcRe
|
|||
aSrc = (col >> 24) & 0xff;
|
||||
} else {
|
||||
// Use the src's pixel format to split up the source pixel
|
||||
format.colorToRGB(format.bytesPerPixel == 2 ? *(const uint16 *)destP : *(const uint32 *)destP,
|
||||
rDest, gDest, bDest);
|
||||
src.format.colorToARGB(src.format.bytesPerPixel == 2
|
||||
? *(const uint16 *)srcP : *(const uint32 *)srcP,
|
||||
aSrc, rSrc, gSrc, bSrc);
|
||||
}
|
||||
|
||||
if (aSrc == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue