-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't accidentally accept invalid glyphNames which *appear* to follow the Cdd{d}/cdd{d} format in PartialEvaluator._buildSimpleFontToUnicode
(issue 11697)
#11698
Conversation
6560cea
to
2c23ee0
Compare
… the Cdd{d}/cdd{d} format in `PartialEvaluator._buildSimpleFontToUnicode` (issue 11697) The /Differences array of the problematic font contains a `/c.1` entry, which is consequently detected as a *possible* Cdd{d}/cdd{d} glyphName by the existing heuristics. Because of how the base 10 conversion is implemented, which is necessary for the base 16 special case, the parsed charCode becomes `0.1` thus causing `String.fromCodePoint` to throw since that obviously isn't a valid code point. To fix the referenced issue, and to hopefully prevent similar ones in the future, the patch adds *additional* validation of the charCode found by the heuristics.
2c23ee0
to
15e8692
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/cc149b7ce785a2c/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/482e5f3221963b6/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/cc149b7ce785a2c/output.txt Total script time: 19.82 mins
Image differences available at: http://54.67.70.0:8877/cc149b7ce785a2c/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/482e5f3221963b6/output.txt Total script time: 25.10 mins
Image differences available at: http://54.215.176.217:8877/482e5f3221963b6/reftest-analyzer.html#web=eq.log |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/f4c76523acdff4d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/f4c76523acdff4d/output.txt Total script time: 2.47 mins Published |
Thank you for debugging and fixing this! /botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/f71493610066c89/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 1 Live output at: http://54.215.176.217:8877/dca09dd8f083fd4/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/f71493610066c89/output.txt Total script time: 18.15 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/dca09dd8f083fd4/output.txt Total script time: 23.16 mins
|
The /Differences array of the problematic font contains a
/c.1
entry, which is consequently detected as a possible Cdd{d}/cdd{d} glyphName by the existing heuristics.Because of how the base 10 conversion is implemented, which is necessary for the base 16 special case, the parsed charCode becomes
0.1
thus causingString.fromCodePoint
to throw since that obviously isn't a valid code point.To fix the referenced issue, and to hopefully prevent similar ones in the future, the patch adds additional validation of the charCode found by the heuristics.
Fixes #11697