aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/psp/osys_psp.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/psp/osys_psp.cpp b/backends/psp/osys_psp.cpp
index 1d5712e226..9bac3f28c6 100644
--- a/backends/psp/osys_psp.cpp
+++ b/backends/psp/osys_psp.cpp
@@ -115,8 +115,15 @@ int OSystem_PSP::getGraphicsMode() const {
void OSystem_PSP::initSize(uint width, uint height) {
_overlayWidth = _screenWidth = width;
_overlayHeight = _screenHeight = height;
+
+ if (_offscreen)
+ free(_offscreen);
+
_offscreen = (byte *)malloc(width * height);
+ if (_overlayBuffer)
+ free(_overlayBuffer);
+
_overlayBuffer = (OverlayColor *)malloc(_overlayWidth * _overlayHeight * sizeof(OverlayColor));
bzero(_offscreen, width * height);
clearOverlay();