Bug 1440943 - Make GetScriptTagForCode safely return UNKNOWN tag if called with a script code that is out of range for the system ICU version. r=m_kato

This commit is contained in:
Jonathan Kew
2018-02-27 10:34:25 +00:00
parent 5a3b63d554
commit b7875435f1

View File

@@ -119,7 +119,11 @@ inline uint32_t
GetScriptTagForCode(Script aScriptCode)
{
const char* tag = uscript_getShortName(UScriptCode(aScriptCode));
return HB_TAG(tag[0], tag[1], tag[2], tag[3]);
if (tag) {
return HB_TAG(tag[0], tag[1], tag[2], tag[3]);
}
// return UNKNOWN script tag (running with older ICU?)
return HB_SCRIPT_UNKNOWN;
}
inline PairedBracketType