diff options
author | Raph Levien <raph@google.com> | 2013-01-09 12:54:26 -0800 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2013-01-09 16:50:37 -0800 |
commit | 83cc8fb6c889fa4d7d8514a5ac263bf0f709a015 (patch) | |
tree | 881360785be2d3f26844ecf9270d3ba83a0f0bec | |
parent | 6842c622d8b68251f7d696d22bfa44a16c0bef46 (diff) | |
download | harfbuzz-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-x | contrib/harfbuzz-unicode.c | 4 |
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), |