BUG: code crashes when DICOM with 12 bits allocated is processed#5561
BUG: code crashes when DICOM with 12 bits allocated is processed#5561Purushoth24051999 wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
Conversation
There was a problem hiding this comment.
Thank you for contributing a pull request! 🙏
Welcome to the ITK community! 🤗👋☀️
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖
This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.
| if (inOutBufferLength != len) | ||
| { | ||
| gdcmDebugMacro("inOutBufferLength = " << inOutBufferLength | ||
| << ", inBufferLength = " << inBufferLength << ", len = " << len) |
There was a problem hiding this comment.
; at the end of the line 123.
Also (line 133, 134)
assert (len == inOutBufferLength);
gdcm_assert(inOutBufferLength == len);becаme unreachable, can be deleted
There was a problem hiding this comment.
@malaterre This issue may be resolved by removing line 133 in the upstream GDCM code. It looks like an assert persists in the code and causes the crash.
There was a problem hiding this comment.
@malaterre This issue may be resolved by removing line 133 in the upstream GDCM code. It looks like an assert persists in the code and causes the crash.
gdcm_assert(exception) won't be caught by ITK, even if it were, there would be a memory leak (copy is freed after this)
There was a problem hiding this comment.
All the builds failed due to Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRAWCodec.cxx:123:86: error: expected ';' after 'static_assert'
There was a problem hiding this comment.
Please see commit f57e45134ce6f0092687d0c4a69b5d7bee991dc5 in git/release branch. Let me know if this is acceptable solution.
Thanks all
There was a problem hiding this comment.
@Purushoth24051999 please check malaterre/GDCM@f57e451. To easily do that, download and build this version of GDCM, then in ITK turn on ITK_USE_SYSTEM_GDCM. Then you should be able to pick GDCM_DIR.
|
This PR maybe/probably should have been made against upstream. |
I've tried malaterre/GDCM by building with ITK_USE_SYSTEM_ITK as ON and linked External GDCM as you suggested it works fine for 12 bits allocated and NRRD file is generated without any issues But I have few questions here, If so, I have modified this PR according to malaterre/GDCM to change contents of gdcmRAWCodec.cxx and gdcmBitmap.cxx files please review it. |
|
It would be ideal if @malaterre tagged a new version. Meanwhile, I will open a PR to update bundled GDCM from 3.2.1 to 3.2.2. |
|
PR #5568 opened. |

PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.