[Scummvm-git-logs] scummvm master -> 5424f70002c8483448225aeb5982b709c2774e46

dreammaster dreammaster at scummvm.org
Sun Sep 24 18:02:56 CEST 2017


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:
5424f70002 IMAGE: Fix memory leak in BitmapRawDecoder


Commit: 5424f70002c8483448225aeb5982b709c2774e46
    https://github.com/scummvm/scummvm/commit/5424f70002c8483448225aeb5982b709c2774e46
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-24T12:02:48-04:00

Commit Message:
IMAGE: Fix memory leak in BitmapRawDecoder

Changed paths:
    image/codecs/bmp_raw.cpp


diff --git a/image/codecs/bmp_raw.cpp b/image/codecs/bmp_raw.cpp
index 68d70f2..1a856f1 100644
--- a/image/codecs/bmp_raw.cpp
+++ b/image/codecs/bmp_raw.cpp
@@ -30,6 +30,8 @@ namespace Image {
 
 BitmapRawDecoder::BitmapRawDecoder(int width, int height, int bitsPerPixel) : Codec(),
 		_surface(0), _width(width), _height(height), _bitsPerPixel(bitsPerPixel) {
+	_surface = new Graphics::Surface();
+	_surface->create(_width, _height, getPixelFormat());
 }
 
 BitmapRawDecoder::~BitmapRawDecoder() {
@@ -42,9 +44,6 @@ BitmapRawDecoder::~BitmapRawDecoder() {
 const Graphics::Surface *BitmapRawDecoder::decodeFrame(Common::SeekableReadStream &stream) {
 	Graphics::PixelFormat format = getPixelFormat();
 
-	_surface = new Graphics::Surface();
-	_surface->create(_width, _height, format);
-
 	int srcPitch = _width * (_bitsPerPixel >> 3);
 	int extraDataLength = (srcPitch % 4) ? 4 - (srcPitch % 4) : 0;
 





More information about the Scummvm-git-logs mailing list