mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
NGI: Fix memory leaks when flipping bitmaps
Coverity CID 1433114 Coverity CID 1433128
This commit is contained in:
1 parent
3809934d21
commit
4fcb00a835
2 files changed
+6
-2
No files matched your search
+3
-1
@@ -577,7 +577,9 @@ void Picture::draw(int x, int y, int style, int angle) {
|
||||
case 1: {
|
||||
//flip
|
||||
const Dims dims = getDimensions();
|
||||
_bitmap->flipVertical()->drawShaded(1, x1, y1 + 30 + dims.y, *pal, _alpha);
|
||||
Bitmap *flipped = _bitmap->flipVertical();
|
||||
flipped->drawShaded(1, x1, y1 + 30 + dims.y, *pal, _alpha);
|
||||
delete flipped;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
||||
@@ -496,7 +496,9 @@ void Movement::draw(bool flipFlag, int angle) {
|
||||
}
|
||||
|
||||
if (flipFlag) {
|
||||
bmp->flipVertical()->drawShaded(1, x, y + 30 + _currDynamicPhase->_rect.bottom, _currDynamicPhase->getPaletteData(), _currDynamicPhase->getAlpha());
|
||||
Bitmap *flipped = bmp->flipVertical();
|
||||
flipped->drawShaded(1, x, y + 30 + _currDynamicPhase->_rect.bottom, _currDynamicPhase->getPaletteData(), _currDynamicPhase->getAlpha());
|
||||
delete flipped;
|
||||
} else if (angle) {
|
||||
bmp->drawRotated(x, y, angle, _currDynamicPhase->getPaletteData(), _currDynamicPhase->getAlpha());
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user