[icu] Make sure we return script UNKNOWN instead of INVALID
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 2 May 2011 16:37:45 +0000 (12:37 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 2 May 2011 16:37:45 +0000 (12:37 -0400)
src/hb-icu.cc

index 52645fd..9b94a94 100644 (file)
@@ -157,6 +157,9 @@ hb_icu_get_script (hb_unicode_funcs_t *ufuncs,
   UErrorCode status = U_ZERO_ERROR;
   UScriptCode scriptCode = uscript_getScript(unicode, &status);
 
+  if (unlikely (status != U_ZERO_ERROR))
+    return HB_SCRIPT_UNKNOWN;
+
   return hb_icu_script_to_script (scriptCode);
 }