Mercurial > hg > orthanc
diff Core/DicomParsing/ParsedDicomFile.cpp @ 2797:9a0c6a046cc2
Fix handling of incoming C-FIND queries containing Generic Group Length (*, 0x0000)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 16 Aug 2018 10:39:30 +0200 |
parents | 6db878376018 |
children | d386abc18133 |
line wrap: on
line diff
--- a/Core/DicomParsing/ParsedDicomFile.cpp Fri Jul 27 16:40:09 2018 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.cpp Thu Aug 16 10:39:30 2018 +0200 @@ -525,6 +525,13 @@ void ParsedDicomFile::Clear(const DicomTag& tag, bool onlyIfExists) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmItem* dicom = pimpl_->file_->getDataset(); @@ -612,6 +619,13 @@ const Json::Value& value, bool decodeDataUriScheme) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + if (pimpl_->file_->getDataset()->tagExists(ToDcmtkBridge::Convert(tag))) { throw OrthancException(ErrorCode_AlreadyExistingTag); @@ -724,6 +738,13 @@ bool decodeDataUriScheme, DicomReplaceMode mode) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmDataset& dicom = *pimpl_->file_->getDataset(); @@ -756,6 +777,13 @@ bool decodeDataUriScheme, DicomReplaceMode mode) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmDataset& dicom = *pimpl_->file_->getDataset();