From 9b0179597e100e85d543b4e346490ed7b2bb2fff Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Sat, 23 Nov 2019 10:07:48 +0100 Subject: [PATCH] [sfnt] Ensure OTTO fonts have tables (#57285). * src/sfnt/ttload.c (tt_face_load_font_dir): Add test. --- ChangeLog | 6 ++++++ src/sfnt/ttload.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 78bd146c7..b921853da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-11-23 Ben Wagner + + [sfnt] Ensure OTTO fonts have tables (#57285). + + * src/sfnt/ttload.c (tt_face_load_font_dir): Add test. + 2019-11-23 Behdad Esfahbod Minor fixes for recent compilers. diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 5443bf4b6..15b01a800 100644 --- a/src/sfnt/ttload.c +++ b/src/sfnt/ttload.c @@ -397,7 +397,15 @@ } } else + { valid_entries = sfnt.num_tables; + if ( !valid_entries ) + { + FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" )); + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + } face->num_tables = valid_entries; face->format_tag = sfnt.format_tag;