Commit 7ebdd585 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Add a separate helper to load FT_Short values (Coverity).

parent 50a66f28
......@@ -1511,7 +1511,15 @@ static LONG reg_load_dword(HKEY hkey, const WCHAR *value, DWORD *data)
return ERROR_SUCCESS;
}
static LONG reg_load_ftlong(HKEY hkey, const WCHAR *value, FT_Long *data)
static inline LONG reg_load_ftlong(HKEY hkey, const WCHAR *value, FT_Long *data)
{
DWORD dw;
LONG ret = reg_load_dword(hkey, value, &dw);
*data = dw;
return ret;
}
static inline LONG reg_load_ftshort(HKEY hkey, const WCHAR *value, FT_Short *data)
{
DWORD dw;
LONG ret = reg_load_dword(hkey, value, &dw);
......@@ -1557,7 +1565,7 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu
needed = sizeof(face->fs);
RegQueryValueExW(hkey_face, face_font_sig_value, NULL, NULL, (BYTE*)&face->fs, &needed);
if(reg_load_dword(hkey_face, face_height_value, (DWORD*)&face->size.height) != ERROR_SUCCESS)
if(reg_load_ftshort(hkey_face, face_height_value, &face->size.height) != ERROR_SUCCESS)
{
face->scalable = TRUE;
memset(&face->size, 0, sizeof(face->size));
......@@ -1565,11 +1573,11 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu
else
{
face->scalable = FALSE;
reg_load_dword(hkey_face, face_width_value, (DWORD*)&face->size.width);
reg_load_ftshort(hkey_face, face_width_value, &face->size.width);
reg_load_ftlong(hkey_face, face_size_value, &face->size.size);
reg_load_ftlong(hkey_face, face_x_ppem_value, &face->size.x_ppem);
reg_load_ftlong(hkey_face, face_y_ppem_value, &face->size.y_ppem);
reg_load_dword(hkey_face, face_internal_leading_value, (DWORD*)&face->size.internal_leading);
reg_load_ftshort(hkey_face, face_internal_leading_value, &face->size.internal_leading);
TRACE("Adding bitmap size h %d w %d size %ld x_ppem %ld y_ppem %ld\n",
face->size.height, face->size.width, face->size.size >> 6,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment