aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-07 21:45:21 +0000
committerFilippos Karapetis2009-01-07 21:45:21 +0000
commit272a9d06a854aa76cfa95b7b91f1b24fccd4f308 (patch)
tree095fcd69d69663dd0f3c270957f8425da95ea641 /graphics
parent88a9a5a6cac12a4e1428aef6776786315f665203 (diff)
downloadscummvm-rg350-272a9d06a854aa76cfa95b7b91f1b24fccd4f308.tar.gz
scummvm-rg350-272a9d06a854aa76cfa95b7b91f1b24fccd4f308.tar.bz2
scummvm-rg350-272a9d06a854aa76cfa95b7b91f1b24fccd4f308.zip
Initialize DXA buffers to 0 when they're allocated
svn-id: r35775
Diffstat (limited to 'graphics')
-rw-r--r--graphics/video/dxa_player.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/graphics/video/dxa_player.cpp b/graphics/video/dxa_player.cpp
index 89ca280ce1..aef0e30354 100644
--- a/graphics/video/dxa_player.cpp
+++ b/graphics/video/dxa_player.cpp
@@ -111,13 +111,16 @@ bool DXAPlayer::loadFile(const char *fileName) {
_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 @@ void DXAPlayer::decode12(int size) {
#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 @@ void DXAPlayer::decode13(int size) {
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 @@ bool DXAPlayer::decodeNextFrame() {
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;