[ATSUI] Prevent segfault in _cairo_atsuii_font_text_to_glyphs (bug 5177) --- commit c9cc2f95179576bf78fb81ccc8067c30c000cdff tree 3bce551a75efe455d807e4e14cd33624d92a8e37 parent 7bc6ad3f956c5ba6c98c26fcf641c0855b65f7ba author Brian Ewins Fri, 22 Dec 2006 00:31:14 +0000 committer Brian Ewins Fri, 22 Dec 2006 00:31:14 +0000 src/cairo-atsui-font.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c index edaa061..e6e20eb 100644 --- a/src/cairo-atsui-font.c +++ b/src/cairo-atsui-font.c @@ -651,6 +651,12 @@ _cairo_atsui_font_text_to_glyphs (void if (status) return status; + if (n16 == 0) { + *num_glyphs = 0; + *glyphs = NULL; + return noErr; + } + err = ATSUCreateTextLayout(&textLayout); err = ATSUSetTextPointerLocation(textLayout, utf16, 0, n16, n16);