diff options
author | Torbjörn Andersson | 2005-08-22 15:39:07 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-08-22 15:39:07 +0000 |
commit | 7d834de666ba1c58d5baad870f4b29676b2ef13b (patch) | |
tree | a5574f36ff6cca90d7e3a6097472e47903510e60 /kyra | |
parent | 8b31ef5dc4aca7668d389ba4ed72f1828b3bf9aa (diff) | |
download | scummvm-rg350-7d834de666ba1c58d5baad870f4b29676b2ef13b.tar.gz scummvm-rg350-7d834de666ba1c58d5baad870f4b29676b2ef13b.tar.bz2 scummvm-rg350-7d834de666ba1c58d5baad870f4b29676b2ef13b.zip |
Fixed two cases where a bad pointer would be freed, causing ScummVM to
crash on my Debian box.
svn-id: r18708
Diffstat (limited to 'kyra')
-rw-r--r-- | kyra/kyra.cpp | 9 | ||||
-rw-r--r-- | kyra/wsamovie.cpp | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 39741a961c..1df94805ad 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -199,18 +199,17 @@ void KyraEngine::loadBitmap(const char *filename, int tempPage, int dstPage, uin if (palData && palSize) { memcpy(palData, srcData + 10, palSize); } - srcData += 10 + palSize; - + uint8 *srcPtr = srcData + 10 + palSize; uint8 *dstData = _screen->getPagePtr(dstPage); switch (compType) { case 0: - memcpy(dstData, srcData, imgSize); + memcpy(dstData, srcPtr, imgSize); break; case 3: - Screen::decodeFrame3(srcData, dstData, imgSize); + Screen::decodeFrame3(srcPtr, dstData, imgSize); break; case 4: - Screen::decodeFrame4(srcData, dstData, imgSize); + Screen::decodeFrame4(srcPtr, dstData, imgSize); break; default: error("Unhandled bitmap compression %d", compType); diff --git a/kyra/wsamovie.cpp b/kyra/wsamovie.cpp index e2ab2242e3..47d96bc247 100644 --- a/kyra/wsamovie.cpp +++ b/kyra/wsamovie.cpp @@ -39,6 +39,7 @@ WSAMovieV1 *KyraEngine::wsa_open(const char *filename, int offscreenDecode, uint wsa->width = READ_LE_UINT16(wsaData); wsaData += 2; wsa->height = READ_LE_UINT16(wsaData); wsaData += 2; wsa->deltaBufferSize = READ_LE_UINT16(wsaData); wsaData += 2; + wsa->offscreenBuffer = NULL; wsa->flags = 0; if (_game == KYRA1CD) { flags = READ_LE_UINT16(wsaData); wsaData += 2; |