From 6e5445a232cbdbf18a45629cf2f12a81c043607f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 15 May 2017 21:24:04 +0200 Subject: [PATCH] [truetype] Fix error handling for embedded bitmaps. Problem reported by Hin-Tak Leung . * src/truetype/ttgload.c (TT_Load_Glyph) [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Handle error if font is not scalable. --- ChangeLog | 10 ++++++++++ src/truetype/ttgload.c | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1d40059c3..ad8ef9506 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-05-15 Werner Lemberg + + [truetype] Fix error handling for embedded bitmaps. + + Problem reported by Hin-Tak Leung . + + * src/truetype/ttgload.c (TT_Load_Glyph) + [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Handle error if font is not + scalable. + 2017-05-15 Alexei Podtelezhnikov [autofit] Make autohint warping NORMAL option. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index b7a844a6c..68a9b4ad5 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2621,7 +2621,13 @@ IS_DEFAULT_INSTANCE ) { error = load_sbit_image( size, glyph, glyph_index, load_flags ); - if ( !error ) + if ( error ) + { + /* return error if font is not scalable */ + if ( !FT_IS_SCALABLE( glyph->face ) ) + return error; + } + else { if ( FT_IS_SCALABLE( glyph->face ) ) {