Mercurial > hg > orthanc
changeset 6143:d6c777a2511f attach-custom-data
integration mainline->attach-custom-data
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 30 May 2025 12:29:41 +0200 |
parents | 93d408173903 (current diff) 66609557a7ee (diff) |
children | f9d6955e22dd |
files | OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp |
diffstat | 7 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Fri May 30 12:29:41 2025 +0200 @@ -566,7 +566,7 @@ { // Check out "../../../OrthancServer/Resources/ImplementationNotes/windowing.py" - float windowWidth = std::abs(window.GetWidth()); + double windowWidth = std::abs(window.GetWidth()); // Avoid divisions by zero static const double MIN = 0.0001;
--- a/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Fri May 30 12:29:41 2025 +0200 @@ -672,7 +672,7 @@ reader.Consume(visitor); isLittleEndian = reader.IsLittleEndian(); } - catch (OrthancException& e) + catch (OrthancException&) { // Invalid DICOM file return false;
--- a/OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp Fri May 30 12:29:41 2025 +0200 @@ -176,7 +176,7 @@ LOG(INFO) << "Created attachment \"" << uuid << "\" (" << timer.GetHumanTransferSpeed(true, size) << ")"; return; } - catch (OrthancException& e) + catch (OrthancException&) { if (retryCount >= maxRetryCount) {
--- a/OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp Fri May 30 12:29:41 2025 +0200 @@ -88,6 +88,12 @@ } else { + const uint64_t size = end - start; + if (static_cast<uint64_t>(static_cast<size_t>(size)) != size) + { + throw OrthancException(ErrorCode_InternalError, "Buffer larger than 4GB, which is too large for Orthanc running in 32bits"); + } + Mutex::ScopedLock lock(mutex_); Content::const_iterator found = content_.find(uuid); @@ -107,7 +113,7 @@ else { std::string range; - range.resize(end - start); + range.resize(static_cast<size_t>(size)); assert(!range.empty()); memcpy(&range[0], &found->second[start], range.size());
--- a/OrthancFramework/Sources/HttpServer/HttpContentNegociation.h Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpContentNegociation.h Fri May 30 12:29:41 2025 +0200 @@ -75,7 +75,7 @@ }; - struct Reference; + class Reference; typedef std::vector<std::string> Tokens; typedef std::list<Handler> Handlers;
--- a/OrthancFramework/Sources/MallocMemoryBuffer.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/MallocMemoryBuffer.cpp Fri May 30 12:29:41 2025 +0200 @@ -76,7 +76,7 @@ } buffer_ = buffer; - size_ = size; + size_ = static_cast<size_t>(size); free_ = freeFunction; if (size_ != 0 &&
--- a/OrthancFramework/Sources/SerializationToolbox.cpp Fri May 30 12:23:19 2025 +0200 +++ b/OrthancFramework/Sources/SerializationToolbox.cpp Fri May 30 12:29:41 2025 +0200 @@ -188,10 +188,11 @@ { ReadArrayOfStrings(target, arr); } - catch (OrthancException& ex) - { // more detailed error + catch (OrthancException&) + { + // more detailed error throw OrthancException(ErrorCode_BadFileFormat, - "List of strings expected in field: " + field); + "List of strings expected in field: " + field); } }