diff options
author | Raph Levien <raph@google.com> | 2013-01-09 12:54:26 -0800 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2013-01-09 12:58:50 -0800 |
commit | 3b569347552cb0559b440e95af6efc1a26f4d753 (patch) | |
tree | 881360785be2d3f26844ecf9270d3ba83a0f0bec | |
parent | 6842c622d8b68251f7d696d22bfa44a16c0bef46 (diff) | |
download | harfbuzz-3b569347552cb0559b440e95af6efc1a26f4d753.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), |