[Scummvm-cvs-logs] scummvm master -> d388981714e8d58d321f42ea67907f59267268f7

eriktorbjorn eriktorbjorn at telia.com
Mon Nov 16 22:10:13 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d388981714 BBVS: Fix recent video player memory leak (CID 1339416)


Commit: d388981714e8d58d321f42ea67907f59267268f7
    https://github.com/scummvm/scummvm/commit/d388981714e8d58d321f42ea67907f59267268f7
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-11-16T22:08:49+01:00

Commit Message:
BBVS: Fix recent video player memory leak (CID 1339416)

Surface::convertTo() creates a new surface, so we have to free it
once we're done with it.

Changed paths:
    engines/bbvs/videoplayer.cpp



diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index f417f27..1b721c4 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -61,8 +61,10 @@ void BbvsEngine::playVideo(int videoNum) {
 			const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
 			if (frame) {
 				if (frame->format.bytesPerPixel > 1) {
-					const Graphics::Surface *frame1 = frame->convertTo(_system->getScreenFormat());
+					Graphics::Surface *frame1 = frame->convertTo(_system->getScreenFormat());
 					_system->copyRectToScreen(frame1->getPixels(), frame1->pitch, 0, 0, frame1->w, frame1->h);
+					frame1->free();
+					delete frame1;
 				} else {
 					_system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
 				}






More information about the Scummvm-git-logs mailing list