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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user