From 08e08f590807a4bc99b5cd1257c8aeace1ca9538 Mon Sep 17 00:00:00 2001 From: Anurag Thakur Date: Wed, 19 Oct 2022 02:18:04 +0530 Subject: Fix monochrome crash --- src/dense/ftdenserend.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dense/ftdenserend.c b/src/dense/ftdenserend.c index cd2aeeb4c..903527bff 100644 --- a/src/dense/ftdenserend.c +++ b/src/dense/ftdenserend.c @@ -75,6 +75,15 @@ take a variable named `memory`. It can only be known if you follow the macros 3 goto Exit; } + /* check mode */ + if ( mode != FT_RENDER_MODE_NORMAL && + mode != FT_RENDER_MODE_LIGHT && + mode != FT_RENDER_MODE_LCD && + mode != FT_RENDER_MODE_LCD_V ) + { + error = FT_THROW( Cannot_Render_Glyph ); + goto Exit; + } /* deallocate the previously allocated bitmap */ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) -- cgit v1.2.1