* src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
This commit is contained in:
parent
cddfe6574b
commit
ef48a33271
|
@ -223,6 +223,8 @@ FT_BEGIN_HEADER
|
||||||
* For example, in the preset hook one can draw the glyph on a recorder
|
* For example, in the preset hook one can draw the glyph on a recorder
|
||||||
* surface and later create a bitmap surface from it in the render hook.
|
* surface and later create a bitmap surface from it in the render hook.
|
||||||
*
|
*
|
||||||
|
* All four hooks must be non-NULL.
|
||||||
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
* init_svg ::
|
* init_svg ::
|
||||||
* The initialization hook.
|
* The initialization hook.
|
||||||
|
|
|
@ -168,16 +168,34 @@
|
||||||
|
|
||||||
|
|
||||||
if ( value_is_string == TRUE )
|
if ( value_is_string == TRUE )
|
||||||
return FT_THROW( Invalid_Argument );
|
{
|
||||||
|
error = FT_THROW( Invalid_Argument );
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
hooks = (SVG_RendererHooks*)value;
|
hooks = (SVG_RendererHooks*)value;
|
||||||
|
|
||||||
|
if ( !hooks->init_svg ||
|
||||||
|
!hooks->free_svg ||
|
||||||
|
!hooks->render_svg ||
|
||||||
|
!hooks->preset_slot )
|
||||||
|
{
|
||||||
|
FT_TRACE0(( "ft_svg_property_set:"
|
||||||
|
" SVG rendering hooks not set because\n" ));
|
||||||
|
FT_TRACE0(( " "
|
||||||
|
" at least one function pointer is NULL\n" ));
|
||||||
|
|
||||||
|
error = FT_THROW( Invalid_Argument );
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
renderer->hooks = *hooks;
|
renderer->hooks = *hooks;
|
||||||
renderer->hooks_set = TRUE;
|
renderer->hooks_set = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error = FT_THROW( Missing_Property );
|
error = FT_THROW( Missing_Property );
|
||||||
|
|
||||||
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue