8287609: macOS: SIGSEGV at [CoreFoundation] CFArrayGetCount / sun.font.CFont.getTableBytesNative

Reviewed-by: prr
This commit is contained in:
Nikita Gubarkov 2022-06-05 15:34:47 +00:00 committed by Phil Race
parent 3df4b034fb
commit 8c460b043e

View File

@ -379,6 +379,9 @@ JNI_COCOA_ENTER(env);
CTFontRef ctfont = (CTFontRef)nsFont;
CFArrayRef tagsArray =
CTFontCopyAvailableTables(ctfont, kCTFontTableOptionNoOptions);
if (tagsArray == NULL) {
return NULL;
}
CFIndex numTags = CFArrayGetCount(tagsArray);
for (i=0; i<numTags; i++) {
if (tag ==