mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 01:21:42 +01:00
JBR-7556 Check negative glyphID in HBShaper
(cherry picked from commit 76852278f4)
This commit is contained in:
committed by
Vitaly Provodin
parent
c8aa5b1b3f
commit
99a842f887
@@ -343,6 +343,7 @@ public class HBShaper {
|
||||
|
||||
Font2D font2D = scopedVars.get().font();
|
||||
int glyphID = font2D.charToGlyph(unicode);
|
||||
if (glyphID < 0) glyphID = 0;
|
||||
@SuppressWarnings("restricted")
|
||||
MemorySegment glyphIDPtr = glyph.reinterpret(4);
|
||||
glyphIDPtr.setAtIndex(JAVA_INT, 0, glyphID);
|
||||
@@ -359,6 +360,7 @@ public class HBShaper {
|
||||
) {
|
||||
Font2D font2D = scopedVars.get().font();
|
||||
int glyphID = font2D.charToVariationGlyph(unicode, variation_selector);
|
||||
if (glyphID < 0) glyphID = 0;
|
||||
@SuppressWarnings("restricted")
|
||||
MemorySegment glyphIDPtr = glyph.reinterpret(4);
|
||||
glyphIDPtr.setAtIndex(JAVA_INT, 0, glyphID);
|
||||
|
||||
Reference in New Issue
Block a user