aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2013-01-09 12:54:26 -0800
committerThe Android Automerger <android-build@android.com>2013-01-09 16:50:37 -0800
commit83cc8fb6c889fa4d7d8514a5ac263bf0f709a015 (patch)
tree881360785be2d3f26844ecf9270d3ba83a0f0bec
parent6842c622d8b68251f7d696d22bfa44a16c0bef46 (diff)
downloadharfbuzz-83cc8fb6c889fa4d7d8514a5ac263bf0f709a015.tar.gz
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
-rwxr-xr-xcontrib/harfbuzz-unicode.c4
1 files changed, 4 insertions, 0 deletions
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 @@ script_property_cmp(const void *vkey, const void *vcandidate) {
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),