From 91e386c5847f0f7ae533ea32d26a05eeed5d5914 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 19 Dec 2008 01:45:55 +0000 Subject: Making curPos an uint32, so that it won't overflow anymore svn-id: r35433 --- graphics/smk_player.cpp | 8 ++++---- graphics/smk_player.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'graphics') diff --git a/graphics/smk_player.cpp b/graphics/smk_player.cpp index 3a5d6e8fe5..f6565c8ac3 100644 --- a/graphics/smk_player.cpp +++ b/graphics/smk_player.cpp @@ -569,7 +569,7 @@ bool SMKPlayer::decodeNextFrame() { if (_header.audioInfo[i].isCompressed) { // Compressed audio (Huffman DPCM encoded) queueCompressedBuffer(soundBuffer, chunkSize, dataSizeUnpacked, i); - delete soundBuffer; + delete[] soundBuffer; } else { // Uncompressed audio (PCM) _audioStream->queueBuffer(soundBuffer, chunkSize); @@ -745,8 +745,8 @@ bool SMKPlayer::decodeNextFrame() { return ++_currentSMKFrame < _header.frames; } -void SMKPlayer::queueCompressedBuffer(byte *buffer, int bufferSize, - int unpackedSize, int streamNum) { +void SMKPlayer::queueCompressedBuffer(byte *buffer, uint32 bufferSize, + uint32 unpackedSize, int streamNum) { BitStream audioBS(buffer, bufferSize); bool dataPresent = audioBS.getBit(); @@ -763,7 +763,7 @@ void SMKPlayer::queueCompressedBuffer(byte *buffer, int bufferSize, byte *unpackedBuffer = new byte[unpackedSize + numBytes]; byte *curPointer = unpackedBuffer; - uint16 curPos = 0; + uint32 curPos = 0; SmallHuffmanTree *audioTrees[4]; for (int k = 0; k < numBytes; k++) diff --git a/graphics/smk_player.h b/graphics/smk_player.h index d7f23b450b..1b8976203d 100644 --- a/graphics/smk_player.h +++ b/graphics/smk_player.h @@ -143,7 +143,7 @@ private: void unpackPalette(); // Possible runs of blocks uint getBlockRun(int index) { return (index <= 58) ? index + 1 : 128 << (index - 59); } - void queueCompressedBuffer(byte *buffer, int bufferSize, int unpackedSize, int streamNum); + void queueCompressedBuffer(byte *buffer, uint32 bufferSize, uint32 unpackedSize, int streamNum); struct AudioInfo { bool isCompressed; -- cgit v1.2.3