aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2011-12-28 00:15:50 +0100
committerTorbjörn Andersson2011-12-28 00:15:50 +0100
commit4ac19d8870d4c154f10f3e4288986b387a08fd41 (patch)
tree1108bce9e3fe8b2afd1442809078a12e31b62f6e
parent0e2b8413e55eb9fa2839d89d7ff3e8270b8b8c29 (diff)
downloadscummvm-rg350-4ac19d8870d4c154f10f3e4288986b387a08fd41.tar.gz
scummvm-rg350-4ac19d8870d4c154f10f3e4288986b387a08fd41.tar.bz2
scummvm-rg350-4ac19d8870d4c154f10f3e4288986b387a08fd41.zip
VIDEO: Fix cppcheck warnings about possible NULL pointer use.
-rw-r--r--video/dxa_decoder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp
index 561719a27d..ca62228178 100644
--- a/video/dxa_decoder.cpp
+++ b/video/dxa_decoder.cpp
@@ -115,9 +115,9 @@ bool DXADecoder::loadStream(Common::SeekableReadStream *stream) {
_scaledBuffer = 0;
if (_scaleMode != S_NONE) {
_scaledBuffer = (uint8 *)malloc(_frameSize);
- memset(_scaledBuffer, 0, _frameSize);
if (!_scaledBuffer)
error("Error allocating scale buffer (size %u)", _frameSize);
+ memset(_scaledBuffer, 0, _frameSize);
}
#ifdef DXA_EXPERIMENT_MAXD
@@ -489,9 +489,9 @@ const Graphics::Surface *DXADecoder::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);
+ memset(_inBuffer, 0, size);
_inBufferSize = size;
}