mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-04 20:00:33 +01:00
truetype: revert use of _cairo_strndup
3d102f25 changed the malloc/memcpy to _cairo_strndup but it won't work
in this case as the string may be UTF-16.
This commit is contained in:
parent
f706ad5aa3
commit
4fbc2ea386
1 changed files with 5 additions and 1 deletions
|
|
@ -1471,10 +1471,14 @@ find_name (tt_name_t *name, unsigned long size, int name_id, int platform, int e
|
|||
if (offset + len > size)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
str = _cairo_strndup (((char*)name) + offset, len);
|
||||
str = _cairo_malloc (len + 1);
|
||||
if (str == NULL)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
memcpy (str,
|
||||
((char*)name) + offset,
|
||||
len);
|
||||
str[len] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue