From 36bfaa6a308654862c5d233fe4e86d9f8c4c02bd Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 15 Jul 2012 02:36:47 +0200 Subject: COMMON: Return NULL in wrapCompressedReadStream for compressed streams when ZLIB is disabled. --- common/zlib.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'common/zlib.cpp') diff --git a/common/zlib.cpp b/common/zlib.cpp index fc8f351054..62904cb150 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -392,17 +392,21 @@ public: #endif // USE_ZLIB SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped, uint32 knownSize) { -#if defined(USE_ZLIB) if (toBeWrapped) { uint16 header = toBeWrapped->readUint16BE(); bool isCompressed = (header == 0x1F8B || ((header & 0x0F00) == 0x0800 && header % 31 == 0)); toBeWrapped->seek(-2, SEEK_CUR); - if (isCompressed) + if (isCompressed) { +#if defined(USE_ZLIB) return new GZipReadStream(toBeWrapped, knownSize); - } +#else + delete toBeWrapped; + return NULL; #endif + } + } return toBeWrapped; } -- cgit v1.2.3 From b4d0a8ba66e2c99949d1fa14d801c7de77db76ba Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 26 Jan 2013 19:33:27 +0100 Subject: JANITORIAL: Enforce "} // End of namespace" with a single space after }. --- common/zlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/zlib.cpp') diff --git a/common/zlib.cpp b/common/zlib.cpp index 62904cb150..920338e57e 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -419,4 +419,4 @@ WriteStream *wrapCompressedWriteStream(WriteStream *toBeWrapped) { } -} // End of namespace Common +} // End of namespace Common -- cgit v1.2.3