You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Re-vendor MetaIO for Z_STREAM_END uncompression check (blocked on Kitware/MetaIO#145) #6694
The vendored MetaIO MET_PerformUncompression (Modules/ThirdParty/MetaIO/src/MetaIO/src/metaUtils.cxx) validates the number of decompressed bytes but not that the zlib stream reached Z_STREAM_END. A compressed stream truncated exactly at the declared output size is therefore accepted, and its trailing Adler-32 checksum is never verified.
Surfaced by an automated review on #6692 (MetaIO 8c41a1d9 re-vendor, now merged).
Blocked on upstream
MetaIO is vendored from Kitware/MetaIO, so this must be fixed upstream and re-vendored — it must not be patched in-place in Modules/ThirdParty/MetaIO/ (an UpdateFromUpstream.sh run would overwrite a local edit).
Confirm the Z_STREAM_END check is present in the re-vendored metaUtils.cxx.
Verify ITKIOMeta tests still pass (the new upstream regression tests testMeta13ImageList / testMeta14ImageCompressed plus the module suite).
Root cause
When the decompressed data fills the destination buffer exactly, the last inflate() returns Z_OK and the next call (with avail_out == 0) returns Z_BUF_ERROR — which is < 0, so the loop exits, but Z_BUF_ERROR is deliberately excluded from the "Uncompress failed" diagnostic. Control reaches the final check with dest_pos == uncompressedDataSize and the function returns true, even though Z_STREAM_END was never reached. See the Greptile P1 thread on #6692 and Kitware/MetaIO#144 for the full trace.
Activity