[Scummvm-cvs-logs] SF.net SVN: scummvm:[35775] scummvm/trunk/graphics/video/dxa_player.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jan 7 22:45:21 CET 2009


Revision: 35775
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35775&view=rev
Author:   thebluegr
Date:     2009-01-07 21:45:21 +0000 (Wed, 07 Jan 2009)

Log Message:
-----------
Initialize DXA buffers to 0 when they're allocated

Modified Paths:
--------------
    scummvm/trunk/graphics/video/dxa_player.cpp

Modified: scummvm/trunk/graphics/video/dxa_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/dxa_player.cpp	2009-01-07 21:43:54 UTC (rev 35774)
+++ scummvm/trunk/graphics/video/dxa_player.cpp	2009-01-07 21:45:21 UTC (rev 35775)
@@ -111,13 +111,16 @@
 	_frameSize = _videoInfo.width * _videoInfo.height;
 	_decompBufferSize = _frameSize;
 	_frameBuffer1 = (uint8 *)malloc(_frameSize);
+	memset(_frameBuffer1, 0, _frameSize);
 	_frameBuffer2 = (uint8 *)malloc(_frameSize);
+	memset(_frameBuffer2, 0, _frameSize);
 	if (!_frameBuffer1 || !_frameBuffer2)
 		error("DXAPlayer: Error allocating frame buffers (size %u)", _frameSize);
 
 	_scaledBuffer = 0;
 	if (_scaleMode != S_NONE) {
 		_scaledBuffer = (uint8 *)malloc(_frameSize);
+		memset(_scaledBuffer, 0, _frameSize);
 		if (!_scaledBuffer)
 			error("Error allocating scale buffer (size %u)", _frameSize);
 	}
@@ -185,6 +188,7 @@
 #ifdef USE_ZLIB
 	if (_decompBuffer == NULL) {
 		_decompBuffer = (byte *)malloc(_decompBufferSize);
+		memset(_decompBuffer, 0, _decompBufferSize);
 		if (_decompBuffer == NULL)
 			error("Error allocating decomp buffer (size %u)", _decompBufferSize);
 	}
@@ -286,6 +290,7 @@
 
 	if (_decompBuffer == NULL) {
 		_decompBuffer = (byte *)malloc(_decompBufferSize);
+		memset(_decompBuffer, 0, _decompBufferSize);
 		if (_decompBuffer == NULL)
 			error("Error allocating decomp buffer (size %u)", _decompBufferSize);
 	}
@@ -485,6 +490,7 @@
 		if ((_inBuffer == NULL) || (_inBufferSize < size)) {
 			free(_inBuffer);
 			_inBuffer = (byte *)malloc(size);
+			memset(_inBuffer, 0, size);
 			if (_inBuffer == NULL)
 				error("Error allocating input buffer (size %u)", size);
 			_inBufferSize = size;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list