mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
TWP: Fix memory leak in capture
Coverity CID 1540483
This commit is contained in:
parent
cdc8d16fd5
commit
0b574ab76b
@ -1763,10 +1763,12 @@ void TwpEngine::capture(Common::WriteStream &stream, Math::Vector2d size) {
|
|||||||
Graphics::Surface s;
|
Graphics::Surface s;
|
||||||
s.init(SCREEN_WIDTH, SCREEN_HEIGHT, 4 * SCREEN_WIDTH, data.data(), fmt);
|
s.init(SCREEN_WIDTH, SCREEN_HEIGHT, 4 * SCREEN_WIDTH, data.data(), fmt);
|
||||||
s.flipVertical(Common::Rect(s.w, s.h));
|
s.flipVertical(Common::Rect(s.w, s.h));
|
||||||
s.scale(size.getX(), size.getY());
|
Graphics::Surface *scaledSurface = s.scale(size.getX(), size.getY());
|
||||||
|
|
||||||
// and save to stream
|
// and save to stream
|
||||||
Image::writePNG(stream, s);
|
Image::writePNG(stream, s);
|
||||||
|
|
||||||
|
delete scaledSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
HSQUIRRELVM TwpEngine::getVm() { return _vm->get(); }
|
HSQUIRRELVM TwpEngine::getVm() { return _vm->get(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user