diff options
author | Matthew Hoops | 2010-05-24 16:51:33 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-05-24 16:51:33 +0000 |
commit | 5ceb896b6b1d4a2d2ac83fdc5552013ab5abedc2 (patch) | |
tree | 16539bd2816e5a8a1c5dd746e4d1c2a0a2bc4536 | |
parent | e9db62b272409580e45e776d4dfcd358670d6ccd (diff) | |
download | scummvm-rg350-5ceb896b6b1d4a2d2ac83fdc5552013ab5abedc2.tar.gz scummvm-rg350-5ceb896b6b1d4a2d2ac83fdc5552013ab5abedc2.tar.bz2 scummvm-rg350-5ceb896b6b1d4a2d2ac83fdc5552013ab5abedc2.zip |
Have the MacResManager ignore resources with length 0.
svn-id: r49190
-rw-r--r-- | common/macresman.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp index de78cedf61..6a6a818083 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -439,6 +439,11 @@ Common::SeekableReadStream *MacResManager::getResource(uint32 typeID, uint16 res _stream->seek(_dataOffset + _resLists[typeNum][resNum].dataOffset); uint32 len = _stream->readUint32BE(); + + // Ignore resources with 0 length + if (!len) + return 0; + return _stream->readStream(len); } @@ -448,6 +453,11 @@ Common::SeekableReadStream *MacResManager::getResource(const Common::String &fil if (_resLists[i][j].nameOffset != -1 && filename.equalsIgnoreCase(_resLists[i][j].name)) { _stream->seek(_dataOffset + _resLists[i][j].dataOffset); uint32 len = _stream->readUint32BE(); + + // Ignore resources with 0 length + if (!len) + return 0; + return _stream->readStream(len); } } |