Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ bool RAWCodec::DecodeBytes(const char* inBytes, size_t inBufferLength,
this->GetPixelFormat() == PixelFormat::INT12 )
{
size_t len = str.size() * 16 / 12;
if (inOutBufferLength != len)
{
gdcmDebugMacro("inOutBufferLength = " << inOutBufferLength
<< ", inBufferLength = " << inBufferLength << ", len = " << len)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; at the end of the line 123.

Also (line 133, 134)

    assert (len == inOutBufferLength);
    gdcm_assert(inOutBufferLength == len);

becаme unreachable, can be deleted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Member

@issakomi issakomi Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the builds failed due to Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRAWCodec.cxx:123:86: error: expected ';' after 'static_assert'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see commit f57e45134ce6f0092687d0c4a69b5d7bee991dc5 in git/release branch. Let me know if this is acceptable solution.

Thanks all

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Member

@issakomi issakomi Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gdcm_assert (it throws an exception) is dead code (luckily)

S1

return false;
}
char * copy = new char[len];
bool b = Unpacker12Bits::Unpack(copy, str.data(), str.size() );
if (!b)
Expand Down
Loading