Mercurial > hg > orthanc
diff OrthancFramework/Sources/Compression/ZlibCompressor.cpp @ 4492:0b2484663233
Fix build on big-endian architectures
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 30 Jan 2021 18:19:11 +0100 |
parents | a8f554ca5ac6 |
children | 7053502fbf97 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/Compression/ZlibCompressor.cpp Fri Jan 29 11:51:42 2021 +0100 +++ b/OrthancFramework/Sources/Compression/ZlibCompressor.cpp Sat Jan 30 18:19:11 2021 +0100 @@ -123,6 +123,9 @@ uint64_t uncompressedSize = ReadUncompressedSizePrefix(compressed, compressedSize); + // New in Orthanc 1.9.0: Explicitly use litte-endian encoding in size prefix + uncompressedSize = le64toh(uncompressedSize); + try { uncompressed.resize(static_cast<size_t>(uncompressedSize)); @@ -132,9 +135,6 @@ throw OrthancException(ErrorCode_NotEnoughMemory); } - // New in Orthanc 1.9.0: Explicitly use litte-endian encoding in size prefix - uncompressedSize = le64toh(uncompressedSize); - uLongf tmp = static_cast<uLongf>(uncompressedSize); int error = uncompress (reinterpret_cast<uint8_t*>(&uncompressed[0]),