* src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault.

This can happen if the function is called with `size` being `NULL`.

Fixes #1147.
This commit is contained in:
Georg Brandl 2022-04-12 11:43:37 +00:00 committed by Werner Lemberg
parent 3100c8120e
commit 978eefee54
1 changed files with 2 additions and 2 deletions

View File

@ -370,8 +370,8 @@
SFNT_Service sfnt;
if ( size->root.metrics.x_ppem < 1 ||
size->root.metrics.y_ppem < 1 )
if ( size && (size->root.metrics.x_ppem < 1 ||
size->root.metrics.y_ppem < 1 ) )
{
error = FT_THROW( Invalid_Size_Handle );
return error;