aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorSven Hesse2008-12-19 01:45:55 +0000
committerSven Hesse2008-12-19 01:45:55 +0000
commit91e386c5847f0f7ae533ea32d26a05eeed5d5914 (patch)
tree0fd385db0b321727d2b75a606dc90226f44873f8 /graphics
parent55edaf0945ba4c9962197a5fbbda76f3a4b8bcee (diff)
downloadscummvm-rg350-91e386c5847f0f7ae533ea32d26a05eeed5d5914.tar.gz
scummvm-rg350-91e386c5847f0f7ae533ea32d26a05eeed5d5914.tar.bz2
scummvm-rg350-91e386c5847f0f7ae533ea32d26a05eeed5d5914.zip
Making curPos an uint32, so that it won't overflow anymore
svn-id: r35433
Diffstat (limited to 'graphics')
-rw-r--r--graphics/smk_player.cpp8
-rw-r--r--graphics/smk_player.h2
2 files changed, 5 insertions, 5 deletions
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;