mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-31 21:50:14 +01:00
win32-font: truncate instead of fail if toy font name too long
http://lists.cairographics.org/archives/cairo/2008-December/016109.html
This commit is contained in:
parent
d99583bae6
commit
6ce97907ed
1 changed files with 4 additions and 5 deletions
|
|
@ -534,12 +534,11 @@ _cairo_win32_font_face_create_for_toy (cairo_toy_font_face_t *toy_face,
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
if (face_name_len > LF_FACESIZE - 1) {
|
||||
free (face_name);
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_STRING);
|
||||
}
|
||||
if (face_name_len > LF_FACESIZE - 1)
|
||||
face_name_len = LF_FACESIZE - 1;
|
||||
|
||||
memcpy (logfont.lfFaceName, face_name, sizeof (uint16_t) * (face_name_len + 1));
|
||||
memcpy (logfont.lfFaceName, face_name, sizeof (uint16_t) * face_name_len);
|
||||
logfont.lfFaceName[face_name_len] = 0;
|
||||
free (face_name);
|
||||
|
||||
logfont.lfHeight = 0; /* filled in later */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue