aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/file-manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hdb/file-manager.cpp')
-rw-r--r--engines/hdb/file-manager.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp
index cafc9cd578..c7f39f7893 100644
--- a/engines/hdb/file-manager.cpp
+++ b/engines/hdb/file-manager.cpp
@@ -173,12 +173,9 @@ Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType
_mpcFile->read(buffer, file->length);
- // Return buffer wrapped in a MemoryReadStream
-
- if (_compressed)
- return Common::wrapCompressedReadStream(new Common::MemoryReadStream(buffer, file->length, DisposeAfterUse::YES));
- else
- return new Common::MemoryReadStream(buffer, file->length, DisposeAfterUse::YES);
+ // Return buffer wrapped in a MemoryReadStream, automatically
+ // uncompressed if it is zlib-compressed
+ return Common::wrapCompressedReadStream(new Common::MemoryReadStream(buffer, file->length, DisposeAfterUse::NO), file->length);
}
int32 FileMan::getLength(const char *string, DataType type) {