Skip to content

Container reader: keep scanning past gaps over 4096 bytes - #153

Merged
mahach666 merged 1 commit into
IOExtend:mainfrom
menes97:fix/container-resync-large-gaps
Nov 12, 2026
Merged

mahach666 merged 1 commit into
IOExtend:mainfrom
menes97:fix/container-resync-large-gaps

Conversation

@menes97

@menes97 menes97 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #20

NwcContainerReader.Read stopped looking for the next zlib signature or #LcUStream header after 4096 unrecognised bytes. A larger gap therefore silently dropped every later stream and section.

MaxResyncGap is removed, and the scan now continues up to the end of the data. The scan is still a single linear pass, and GapBefore / TrailingGap accounting is unchanged. The decompression limits in #19 are a separate issue and are not touched here.

Test: ContainerReaderTests.Read_LargeGaps_PreservesLaterStreamsSectionsAndGapAccounting builds a container with three compressed payloads, two sections and 5000-byte gaps, with and without a trailing gap. It checks every payload, the section of each stream, GapBefore and TrailingGap. Both cases fail without the src change (1 section instead of 2).

dotnet build NwcIO.slnx succeeds, and NwcIO.Tests passes locally: 241 passed, and 2 skipped because they need private Navisworks files (.NET 10.0.400 on Windows, with global.json pinned down to it temporarily; not committed).

The change was drafted with OpenAI Codex, then reviewed and verified with Claude Code.

🤖 Generated with Claude Code

The resync scan between streams stopped after 4096 unrecognised bytes,
so a larger gap silently dropped every later stream and section. The
scan now continues to the next zlib signature or section header up to
the end of the file; gap accounting is unchanged.

Fixes IOExtend#20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mahach666
mahach666 merged commit 0f00dec into IOExtend:main Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Container reader silently stops at a non-zlib gap larger than 4096 bytes, dropping all later streams and sections

2 participants