From df14e6c0b9592cbb24d5381dfc6106b14f915e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Wed, 19 Feb 2014 08:42:52 +0100 Subject: [PATCH] Fix Savannah bug #41590. * src/type1/t1load.c (parse_encoding): Protect against invalid number. --- ChangeLog | 7 +++++++ src/type1/t1load.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 945962f9e..c1d5aeabd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,13 @@ * src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'. +2014-02-19 Simon Bünzli + + Fix Savannah bug #41590. + + * src/type1/t1load.c (parse_encoding): Protect against invalid + number. + 2014-02-12 Dave Arnold [cff] Optimize by using `FT_MulDiv'. diff --git a/src/type1/t1load.c b/src/type1/t1load.c index d4171d967..e2da9565e 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -1274,6 +1274,13 @@ { charcode = (FT_Int)T1_ToInt( parser ); T1_Skip_Spaces( parser ); + + /* protect against invalid charcode */ + if ( cur == parser->root.cursor ) + { + parser->root.error = FT_THROW( Unknown_File_Format ); + return; + } } cur = parser->root.cursor;