mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-29 14:42:26 +00:00
WAGE: Fix memory leak in drawBitmap()
The 'tmp' surface was never freed when in _boundsCalculationMode.
This commit is contained in:
parent
9284204cf6
commit
72269b6c9d
@ -474,28 +474,27 @@ void Design::drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadS
|
|||||||
|
|
||||||
in.skip(numBytes);
|
in.skip(numBytes);
|
||||||
|
|
||||||
if (_boundsCalculationMode)
|
if (!_boundsCalculationMode) {
|
||||||
return;
|
Graphics::FloodFill ff(&tmp, kColorWhite, kColorGreen);
|
||||||
|
for (int yy = 0; yy < h; yy++) {
|
||||||
|
ff.addSeed(0, yy);
|
||||||
|
ff.addSeed(w - 1, yy);
|
||||||
|
}
|
||||||
|
for (int xx = 0; xx < w; xx++) {
|
||||||
|
ff.addSeed(xx, 0);
|
||||||
|
ff.addSeed(xx, h - 1);
|
||||||
|
}
|
||||||
|
ff.fill();
|
||||||
|
|
||||||
Graphics::FloodFill ff(&tmp, kColorWhite, kColorGreen);
|
for (y = 0; y < h && y1 + y < surface->h; y++) {
|
||||||
for (int yy = 0; yy < h; yy++) {
|
byte *src = (byte *)tmp.getBasePtr(0, y);
|
||||||
ff.addSeed(0, yy);
|
byte *dst = (byte *)surface->getBasePtr(x1, y1 + y);
|
||||||
ff.addSeed(w - 1, yy);
|
for (x = 0; x < w; x++) {
|
||||||
}
|
if (*src != kColorGreen)
|
||||||
for (int xx = 0; xx < w; xx++) {
|
*dst = *src;
|
||||||
ff.addSeed(xx, 0);
|
src++;
|
||||||
ff.addSeed(xx, h - 1);
|
dst++;
|
||||||
}
|
}
|
||||||
ff.fill();
|
|
||||||
|
|
||||||
for (y = 0; y < h && y1 + y < surface->h; y++) {
|
|
||||||
byte *src = (byte *)tmp.getBasePtr(0, y);
|
|
||||||
byte *dst = (byte *)surface->getBasePtr(x1, y1 + y);
|
|
||||||
for (x = 0; x < w; x++) {
|
|
||||||
if (*src != kColorGreen)
|
|
||||||
*dst = *src;
|
|
||||||
src++;
|
|
||||||
dst++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user