]> git.tdb.fi Git - ttf2png.git/commitdiff
Don't crash if no glyphs were found
authorMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 13:28:50 +0000 (16:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 13:28:50 +0000 (16:28 +0300)
ttf2png.c

index 15b554dbfc22291797830264a38d537269fe3b96..7cd94551202ff74897f2687a0d8dc597adc1b5ae 100644 (file)
--- 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