Repository navigation
Accept small section size overshoot and zero-fill the tail - #47
Merged
Merged
Conversation
Some writers declare a section a few bytes larger than its pages can hold. The size guard rejected such sections even though every page decompressed and verified, which made AcDb:Classes unreadable in a few AC1032 drawings. Allow up to 256 bytes beyond the page budget, zero-fill the uncovered tail and report a diagnostic through the document. A declared size far beyond the budget is still rejected before allocation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12
Problem
Some AC1032 drawings declare
AcDb:Classesas 89,091 bytes while its three pages can hold 89,088 bytes (3 × 29,696). Every page decompresses to exactly the page size and all checksums pass, but the size guard inR2004Container.ReadSectionrejected the section before reading any page. The same guard also makesCrcVerification_PassesOnRealFilesfail on those files.Change
Diagnostics.DwgDocument.ReadSectionand the internal section reads now pass the diagnostics collector to the container; synthetic container callers can supply their own callback.Tests
Verification
dotnet build DwgIO.slnx -c Release: succeeded.dotnet test DwgIO.slnx -c Release --no-build: 70 passed, 7 fixture tests skipped, 0 failed on net8.0 and net10.0.CrcVerification_PassesOnRealFilesagainst 668 supported drawings (AC1024/AC1027/AC1032): passed on net8.0 and net10.0, including the two drawings that previously failed with theAcDb:Classessize error.