* Do not crash if the face has no charmaps. Bug found using zzuf: xvfb-run zzuf -q -F5 -r0.0000001:0.1 -s0:10000 -c CTest EunjinNakseo.ttf
diff --git a/src/FTCharmap.cpp b/src/FTCharmap.cpp
index b09045b..d0a0433 100644
--- a/src/FTCharmap.cpp
+++ b/src/FTCharmap.cpp
@@ -35,6 +35,13 @@ FTCharmap::FTCharmap(FTFace* face)
{
if(!ftFace->charmap)
{
+ if(!ftFace->num_charmaps)
+ {
+ // This face doesn't even have one charmap!
+ err = 0x96; // Invalid_CharMap_Format
+ return;
+ }
+
err = FT_Set_Charmap(ftFace, ftFace->charmaps[0]);
}