Werner Lemberg pushed to branch master at FreeType / FreeType
Commits:
-
ef48a332
by Werner Lemberg at 2022-01-23T19:05:15+01:00
2 changed files:
Changes:
... | ... | @@ -223,6 +223,8 @@ FT_BEGIN_HEADER |
223 | 223 |
* For example, in the preset hook one can draw the glyph on a recorder
|
224 | 224 |
* surface and later create a bitmap surface from it in the render hook.
|
225 | 225 |
*
|
226 |
+ * All four hooks must be non-NULL.
|
|
227 |
+ *
|
|
226 | 228 |
* @fields:
|
227 | 229 |
* init_svg ::
|
228 | 230 |
* The initialization hook.
|
... | ... | @@ -168,16 +168,34 @@ |
168 | 168 |
|
169 | 169 |
|
170 | 170 |
if ( value_is_string == TRUE )
|
171 |
- return FT_THROW( Invalid_Argument );
|
|
171 |
+ {
|
|
172 |
+ error = FT_THROW( Invalid_Argument );
|
|
173 |
+ goto Exit;
|
|
174 |
+ }
|
|
172 | 175 |
|
173 | 176 |
hooks = (SVG_RendererHooks*)value;
|
174 | 177 |
|
178 |
+ if ( !hooks->init_svg ||
|
|
179 |
+ !hooks->free_svg ||
|
|
180 |
+ !hooks->render_svg ||
|
|
181 |
+ !hooks->preset_slot )
|
|
182 |
+ {
|
|
183 |
+ FT_TRACE0(( "ft_svg_property_set:"
|
|
184 |
+ " SVG rendering hooks not set because\n" ));
|
|
185 |
+ FT_TRACE0(( " "
|
|
186 |
+ " at least one function pointer is NULL\n" ));
|
|
187 |
+ |
|
188 |
+ error = FT_THROW( Invalid_Argument );
|
|
189 |
+ goto Exit;
|
|
190 |
+ }
|
|
191 |
+ |
|
175 | 192 |
renderer->hooks = *hooks;
|
176 | 193 |
renderer->hooks_set = TRUE;
|
177 | 194 |
}
|
178 | 195 |
else
|
179 | 196 |
error = FT_THROW( Missing_Property );
|
180 | 197 |
|
198 |
+ Exit:
|
|
181 | 199 |
return error;
|
182 | 200 |
}
|
183 | 201 |
|