Skip to content

Commit 6e6a39d

Browse files
committed
8347321: [ubsan] CGGlyphImages.m:553:30: runtime error: nan is outside the range of representable values of type 'unsigned long'
Reviewed-by: kizune, azvegint, aivanov
1 parent b84b292 commit 6e6a39d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/java.desktop/macosx/classes/sun/font/CStrike.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,17 @@ public long getNativeStrikePtr() {
102102
final double[] glyphTx = new double[6];
103103
desc.glyphTx.getMatrix(glyphTx);
104104

105+
for (int i = 0; i < 6; i++) {
106+
if (Double.isFinite(glyphTx[i])) {
107+
continue;
108+
}
109+
for (int j = 0; j < 6; j++) {
110+
glyphTx[j] = 0;
111+
}
112+
invDevTx = null;
113+
break;
114+
}
115+
105116
final double[] invDevTxMatrix = new double[6];
106117
if (invDevTx == null) {
107118
invDevTxMatrix[0] = 1;

0 commit comments

Comments
 (0)