mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 05:48:00 +02:00
[cairo] Harden the text API against NULL strings.
Handle NULL strings in cairo_show_(text|glyph), cairo_(text|glyph)_(extents|path) without crashing.
This commit is contained in:
parent
864dab828b
commit
6cc75cfe5b
1 changed files with 6 additions and 0 deletions
|
|
@ -3019,6 +3019,9 @@ cairo_text_path (cairo_t *cr, const char *utf8)
|
|||
if (cr->status)
|
||||
return;
|
||||
|
||||
if (utf8 == NULL)
|
||||
return;
|
||||
|
||||
cairo_get_current_point (cr, &x, &y);
|
||||
|
||||
status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8,
|
||||
|
|
@ -3076,6 +3079,9 @@ cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
|
|||
if (cr->status)
|
||||
return;
|
||||
|
||||
if (num_glyphs == 0)
|
||||
return;
|
||||
|
||||
status = _cairo_gstate_glyph_path (cr->gstate,
|
||||
glyphs, num_glyphs,
|
||||
cr->path);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue