Sanitize coverage table results during shaping.#516
Merged
JimBobSquarePants merged 1 commit intomainfrom Mar 18, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #516 +/- ##
=====================================
- Coverage 82% 82% -1%
=====================================
Files 305 305
Lines 21530 21532 +2
Branches 3164 3164
=====================================
+ Hits 17817 17818 +1
Misses 2900 2900
- Partials 813 814 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Prerequisites
Description
Fixes #514
This pull request improves the robustness of font table lookup and substitution logic by adding comprehensive bounds checks to prevent out-of-range access. It also updates several tests to use new or renamed test font references and introduces a new test and font file for Issue 514.
Enhancements to font lookup and substitution safety:
TryUpdatePositionandTrySubstitutionmethods for GPOS and GSUB lookup subtable classes, ensuring coverage indices are within valid array bounds before accessing records or tables. This prevents potential out-of-range exceptions during font processing. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]Test improvements and new test coverage:
tests/Fonts/Issues/Issue514.ttf) and corresponding test class (tests/SixLabors.Fonts.Tests/Issues/Issues_514.cs) to ensure correct handling of LookupType2Format1SubTable, addressing Issue 514. [1] [2]