diff options
author | richiesams | 2013-08-11 16:42:40 -0500 |
---|---|---|
committer | richiesams | 2013-08-11 16:42:40 -0500 |
commit | d8e45fc438a546bd7e1f8c66e345aafb33bb2a56 (patch) | |
tree | 8125e231a2079d90fde8900b151cc6ca847a6c6c /engines/zvision | |
parent | e3f352cb0c3247f72dfc1f6fe65c57ada64f9755 (diff) | |
download | scummvm-rg350-d8e45fc438a546bd7e1f8c66e345aafb33bb2a56.tar.gz scummvm-rg350-d8e45fc438a546bd7e1f8c66e345aafb33bb2a56.tar.bz2 scummvm-rg350-d8e45fc438a546bd7e1f8c66e345aafb33bb2a56.zip |
ZVISION: Only allocate memory for the scaled buffer if we're actually going to scale the video
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/video.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/zvision/video.cpp b/engines/zvision/video.cpp index 2a320cb790..0836eef496 100644 --- a/engines/zvision/video.cpp +++ b/engines/zvision/video.cpp @@ -106,7 +106,10 @@ void ZVision::playVideo(Video::VideoDecoder &videoDecoder, const Common::Rect &d uint16 finalWidth = origWidth * scale; uint16 finalHeight = origHeight * scale; - byte *scaledVideoFrameBuffer = new byte[finalWidth * finalHeight * bytesPerPixel]; + byte *scaledVideoFrameBuffer; + if (scale != 1) { + scaledVideoFrameBuffer = new byte[finalWidth * finalHeight * bytesPerPixel]; + } uint16 x = ((_width - finalWidth) / 2) + destRect.left; uint16 y = ((_height - finalHeight) / 2) + destRect.top; @@ -158,7 +161,9 @@ void ZVision::playVideo(Video::VideoDecoder &videoDecoder, const Common::Rect &d _clock.start(); - delete[] scaledVideoFrameBuffer; + if (scale != 1) { + delete[] scaledVideoFrameBuffer; + } // Reset the pixel format to the original state initGraphics(_width, _height, true, &_pixelFormat); |