# HG changeset patch # User Sebastien Jodogne # Date 1788158464 -7200 # Node ID 9fc5589b40bcfab363f0eb9b0753d2794d9b2f1c # Parent df883e1f5d7953e619232dd69db638665a2812d9 added more tolerance to invalid OW value representations diff -r df883e1f5d79 -r 9fc5589b40bc NEWS --- a/NEWS Mon Aug 31 08:21:57 2026 +0200 +++ b/NEWS Mon Aug 31 08:41:04 2026 +0200 @@ -10,6 +10,7 @@ ----------- * Fixed a TCP socket leak when a DICOM association is received with an invalid calling AET. +* Added more tolerance to invalid OW value representations * New CMake options: - "THIRD_PARTY_DOWNLOADS_ROOT_URL" to specify another webserver to downloads the third-parties from. - "ORTHANC_SOURCES_DOWNLOADS_ROOT_URL" to specify another webserver to downloads the Orthanc sources from. diff -r df883e1f5d79 -r 9fc5589b40bc OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon Aug 31 08:21:57 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon Aug 31 08:41:04 2026 +0200 @@ -1009,7 +1009,7 @@ value = boost::lexical_cast(content_[index]); } - void ReadArrayOfIntegers(std::vector& target) const + bool ReadArrayOfIntegers(std::vector& target) const { if (valid_) { @@ -1018,10 +1018,11 @@ { target[i] = content_[i]; } + return true; } else { - throw OrthancException(ErrorCode_BadFileFormat); + return false; } } }; @@ -3922,8 +3923,15 @@ { ValueRepresentationReader_OW reader(element); std::vector values; - reader.ReadArrayOfIntegers(values); - action = visitor.VisitIntegers(parentTags, parentIndexes, tag, vr, values); + if (reader.ReadArrayOfIntegers(values)) + { + action = visitor.VisitIntegers(parentTags, parentIndexes, tag, vr, values); + } + else + { + LOG(INFO) << "Tag does not follow a valid OW value representation: " << tag.Format(); + action = visitor.VisitNotSupported(parentTags, parentIndexes, tag, vr); + } break; }