From f80db26b7c5db7c120f5b38defa15fed232f6e96 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 14 Apr 2018 16:28:50 +0300 Subject: [PATCH] Don't crash if no glyphs were found --- ttf2png.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ttf2png.c b/ttf2png.c index 15b554d..7cd9455 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -210,6 +210,12 @@ int main(int argc, char **argv) if(err) return 1; + if(!font.n_glyphs) + { + fprintf(stderr, "No glyphs found in the requested range\n"); + return 1; + } + if(pack) err = render_packed(&font, margin, padding); else -- 2.45.2