diff options
author | Sven Hesse | 2011-05-05 21:40:54 +0200 |
---|---|---|
committer | Sven Hesse | 2011-05-06 16:47:49 +0200 |
commit | 6fb232b9ff72cccf15df5faf5e1191b50957fec2 (patch) | |
tree | ab7c51cd098a98066d5c8d097c27a8e6340fa6d3 | |
parent | f0087e46087f4a278f8dc2aae8b31800d439f9df (diff) | |
download | scummvm-rg350-6fb232b9ff72cccf15df5faf5e1191b50957fec2.tar.gz scummvm-rg350-6fb232b9ff72cccf15df5faf5e1191b50957fec2.tar.bz2 scummvm-rg350-6fb232b9ff72cccf15df5faf5e1191b50957fec2.zip |
GOB: Create a SafeSubReadStream for files in STKs
Instead of memcpy'ing them into a MemoryReadStream.
This is necessary for the lower end PSPs to run Urban Runner with
its comparably big VMD videos.
-rw-r--r-- | engines/gob/dataio.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index 78fc0ab3c1..aa2743b5ed 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -26,6 +26,7 @@ #include "common/endian.h" #include "common/types.h" #include "common/memstream.h" +#include "common/substream.h" #include "gob/gob.h" #include "gob/dataio.h" @@ -345,9 +346,8 @@ Common::SeekableReadStream *DataIO::getFile(File &file) { if (!file.archive->file.seek(file.offset)) return 0; - Common::SeekableReadStream *rawData = file.archive->file.readStream(file.size); - if (!rawData) - return 0; + Common::SeekableReadStream *rawData = + new Common::SafeSubReadStream(&file.archive->file, file.offset, file.offset + file.size); if (!file.packed) return rawData; |