Repository navigation
fix: resolve reported PBP, MDS and CHD failures - #22
Merged
Merged
Conversation
Accept short final PBP blocks from the declared ISO size, route mislabelled ISOs by their volume descriptor, degrade gracefully when MDSSharp is unavailable, and stop forwarding CHDSharp hunk diagnostics as separate bug reports. Also resolve the two remaining Path.Combine code-scanning notes in the MDS tests.
Comment on lines
+10077
to
+10080
| catch (Exception clipboardEx) | ||
| { | ||
| LogMessage($"Failed to copy URL to clipboard: {clipboardEx.Message}"); | ||
| } |
| // A plain 2048-byte-sector ISO has no signature in its first sector; the ISO9660 primary | ||
| // volume descriptor at sector 16 is what identifies it. This is the shape of the .pbp | ||
| // files that were really renamed ISOs and failed with InvalidHeader. | ||
| var path = Path.Combine(_tempDir, "game.pbp"); |
| // A disc whose sector count is not a multiple of 16 can store its last index block with | ||
| // only the sectors the image actually contains. The block is complete at its own declared | ||
| // size, not at the padded 16-sector size, and must extract successfully. | ||
| var path = Path.Combine(_tempDir, $"shortfinal_{Guid.NewGuid():N}.pbp"); |
| pbp.Discs[0].ExtractTo(outputStream); | ||
| Assert.Equal(expectedIsoSize, (uint)outputStream.Length); | ||
|
|
||
| var binPath = Path.Combine(_tempDir, $"{Guid.NewGuid():N}.bin"); |
| // A plain 2048-byte-sector ISO has no signature in its first sector; the ISO9660 primary | ||
| // volume descriptor at sector 16 is what identifies it. This is the shape of the .pbp | ||
| // files that were really renamed ISOs and failed with InvalidHeader. | ||
| var path = Path.Combine(_tempDir, "game.pbp"); |
| // A disc whose sector count is not a multiple of 16 can store its last index block with | ||
| // only the sectors the image actually contains. The block is complete at its own declared | ||
| // size, not at the padded 16-sector size, and must extract successfully. | ||
| var path = Path.Combine(_tempDir, $"shortfinal_{Guid.NewGuid():N}.pbp"); |
| pbp.Discs[0].ExtractTo(outputStream); | ||
| Assert.Equal(expectedIsoSize, (uint)outputStream.Length); | ||
|
|
||
| var binPath = Path.Combine(_tempDir, $"{Guid.NewGuid():N}.bin"); |
Comment on lines
+10077
to
+10080
| catch (Exception clipboardEx) | ||
| { | ||
| LogMessage($"Failed to copy URL to clipboard: {clipboardEx.Message}"); | ||
| } |
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.
Summary
InvalidHeader..pbpcontent, permission/privilege failures, browser-launch failures and CHDSharp hunk diagnostics are classified as user-data/environment conditions instead of new bug reports.cs/path-combinenotes inMdsTests.csnow usePath.Join.Verification
dotnet build CSharp_CHDStudio.sln -c Release- 0 warnings, 0 errorsdotnet test CHDStudio.Tests/CHDStudio.Tests.csproj -c Release- 1331 passed, 0 failedjb inspectcode- 0 warnings, 0 errors