diff options
author | Sven Hesse | 2008-12-27 18:57:36 +0000 |
---|---|---|
committer | Sven Hesse | 2008-12-27 18:57:36 +0000 |
commit | 2b37e183dcdb1c95db71dc07dace4c0ef7b9ddc7 (patch) | |
tree | b1143d44962b4a58cacdbfa537245e0d35a88c85 /graphics | |
parent | 87a27477441ac9812406eb441465a5b9fddae85d (diff) | |
download | scummvm-rg350-2b37e183dcdb1c95db71dc07dace4c0ef7b9ddc7.tar.gz scummvm-rg350-2b37e183dcdb1c95db71dc07dace4c0ef7b9ddc7.tar.bz2 scummvm-rg350-2b37e183dcdb1c95db71dc07dace4c0ef7b9ddc7.zip |
Fixing the invalid read (BitStream having a 2 byte lookahead and all :P)
svn-id: r35579
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/video/smk_player.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/video/smk_player.cpp b/graphics/video/smk_player.cpp index 298e9c6598..96ccd8e5e8 100644 --- a/graphics/video/smk_player.cpp +++ b/graphics/video/smk_player.cpp @@ -569,9 +569,11 @@ bool SMKPlayer::decodeNextFrame() { if (_header.audioInfo[i].hasAudio && chunkSize > 0 && i == 0) { // If it's track 0, play the audio data - byte *soundBuffer = new byte[chunkSize]; + byte *soundBuffer = new byte[chunkSize + 2]; _fileStream->read(soundBuffer, chunkSize); + soundBuffer[chunkSize] = 0; + soundBuffer[chunkSize + 1] = 0; if (_header.audioInfo[i].isCompressed) { // Compressed audio (Huffman DPCM encoded) |