From a2225ae961d16185d7191b5fbb325addc5f4048f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 1 Nov 2019 21:34:38 +1100 Subject: [PATCH] Employ same condition used to set glyph --- src/_imagingft.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/_imagingft.c b/src/_imagingft.c index 0e8622844..146df095b 100644 --- a/src/_imagingft.c +++ b/src/_imagingft.c @@ -791,7 +791,7 @@ font_render(FontObject* self, PyObject* args) int index, error, ascender, horizontal_dir; int load_flags; unsigned char *source; - FT_Glyph glyph = NULL; + FT_Glyph glyph; FT_GlyphSlot glyph_slot; FT_Bitmap bitmap; FT_BitmapGlyph bitmap_glyph; @@ -951,9 +951,8 @@ font_render(FontObject* self, PyObject* args) } x += glyph_info[i].x_advance; y -= glyph_info[i].y_advance; - if (glyph != NULL) { + if (stroker != NULL) { FT_Done_Glyph(glyph); - glyph = NULL; } }