# HG changeset patch # User Sebastien Jodogne # Date 1614175674 -3600 # Node ID 93a51d228d802491904a3266aaa1c88f14900a90 # Parent 31f940334496b7b919beb5e667fb5cd90fc5d57c fix segmentation fault during anonymization on big-endian architectures diff -r 31f940334496 -r 93a51d228d80 OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Feb 24 12:39:35 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Feb 24 15:07:54 2021 +0100 @@ -2299,7 +2299,8 @@ Uint16* data16 = NULL; Uint8* data = NULL; - if (evr == EVR_OW && + if ((element.getTag() == DCM_PixelData || // (*) New in Orthanc 1.9.1 + evr == EVR_OW) && element.getUint16Array(data16) == EC_Normal) { visitor.VisitBinary(parentTags, parentIndexes, tag, vr, data16, element.getLength()); @@ -2307,6 +2308,14 @@ else if (evr != EVR_OW && element.getUint8Array(data) == EC_Normal) { + /** + * WARNING: The call to "getUint8Array()" crashes + * (segmentation fault) on big-endian architectures if applied + * to pixel data, during the call to "swapIfNecessary()" in + * "DcmPolymorphOBOW::getUint8Array()" (this method is not + * reimplemented in derived class "DcmPixelData"). However, + * "getUint16Array()" works correctly, hence (*). + **/ visitor.VisitBinary(parentTags, parentIndexes, tag, vr, data, element.getLength()); } else