fix segfault boo#1198497 OBS-URL: https://build.opensuse.org/request/show/970451 OBS-URL: https://build.opensuse.org/package/show/M17N/freetype2?expand=0&rev=172
33 lines
910 B
Diff
33 lines
910 B
Diff
From 978eefee5401abee6bf702c6bcde9afb47893145 Mon Sep 17 00:00:00 2001
|
|
From: Georg Brandl <georg@python.org>
|
|
Date: Tue, 12 Apr 2022 11:43:37 +0000
|
|
Subject: [PATCH] * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]:
|
|
Fix segfault.
|
|
References: boo#1198497
|
|
|
|
This can happen if the function is called with `size` being `NULL`.
|
|
|
|
Fixes #1147.
|
|
---
|
|
src/cff/cffgload.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
|
|
index 5c15c804b..7586b886f 100644
|
|
--- a/src/cff/cffgload.c
|
|
+++ b/src/cff/cffgload.c
|
|
@@ -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;
|
|
--
|
|
2.35.1
|
|
|