[gl] avoid crash with system libftgl#22101
[gl] avoid crash with system libftgl#22101ferdymercury wants to merge 1 commit intoroot-project:masterfrom
Conversation
Fixes root-project#22076 (Maybe) since ulrichard/ftgl@84869ec#diff-1462936246cba8b5e9ee1c79a1207cea8efb0658be58cd25e7d3acd817ac0ac0R374 so 2.1.3, there is a regression that does not correctly find symbols above code 191. So clamp the text to that max to avoid crashes, if we are using system-ftgl which is for most distributions 2.4 and for some older ones 2.1.3. Do not clamp for builtin-ftgl since it was forked at 2.1.2, before the regression happened More details
Test Results 22 files 22 suites 3d 10h 45m 59s ⏱️ For more details on these failures, see this check. Results for commit 49c6c9b. |
|
PR goes in right direction, but there should be a way to use all symbols with external And most probably such re-coding will be simple - like |
What do you think about ulrichard/ftgl@84869ec#diff-1462936246cba8b5e9ee1c79a1207cea8efb0658be58cd25e7d3acd817ac0ac0R374 Isn't the fact that it assumes UTF8 multibytes preventing us from doing such simple remapping that you propose? |
|
I am off until Monday, but then I will try to investigate this. |
Builtin (2.1.2) converts each char to one glyph in order. External (2.1.3) converts each char to one glyph in order if char <192. If char between 192 and 192+16, then it reads also the next char at once and then does the conversion. If 192+32 it's three bytes it assumes. That's why, when I just prevented nullptr access, I was seeing Int being converted to three random glyphs. So each char int, nabla or epsilon was getting two or three glyphs together, not just one. Probably accessing garbage memory. |
But then solution is clear - one need to transform string so that final result lead to same set of |
Fixes #22076
(Maybe) since ulrichard/ftgl@84869ec#diff-1462936246cba8b5e9ee1c79a1207cea8efb0658be58cd25e7d3acd817ac0ac0R374
so 2.1.3, there is a regression that does not correctly find symbols above code 191. So clamp the text to that max to avoid crashes, if we are using system-ftgl which is for most distributions 2.4 and for some older ones 2.1.3.
Do not clamp for builtin-ftgl since it was forked at 2.1.2, before the regression happened
More details in the linked issue.
fyi @osschar
All latex*.C scripts now run without crashing!