Fix bug 7967800 native crash in text layout
This patch works around a recent change to bionic that was intented to
throw an assert on null pointer, but actually threw on 0 unicode code
point, because it uses a type pun to cast the unicode code point to a
pointer type.
Change-Id: I6ebf2583201fcf8a39490877b74eceb695b8fcd0
diff --git a/contrib/harfbuzz-unicode.c b/contrib/harfbuzz-unicode.c
index 432d5b0..3c1b08d 100755
--- a/contrib/harfbuzz-unicode.c
+++ b/contrib/harfbuzz-unicode.c
@@ -78,6 +78,10 @@
HB_Script
code_point_to_script(uint32_t cp) {
+ if (cp == 0) {
+ // bsearch can throw an assertion on null pointer, so skip if zero
+ return HB_Script_Common;
+ }
const void *vprop = bsearch((void *) (intptr_t) cp, script_properties,
script_properties_count,
sizeof(struct script_property),