]> granicus.if.org Git - libass/commitdiff
font: check FT_Get_Postscript_Name return value for NULL
authorOleg Oshmyan <chortos@inbox.lv>
Wed, 21 Oct 2015 23:43:03 +0000 (02:43 +0300)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 22 Oct 2015 23:46:38 +0000 (02:46 +0300)
libass/ass_font.c

index 0b924b5b4f1e839b1b3bf1726f2142950a34a726..abc661ea8b53c8eccd9ce0f1224381f36aaa9fa3 100644 (file)
@@ -201,7 +201,9 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch)
                     return -1;
                 }
 
-                if (strcmp(FT_Get_Postscript_Name(face), postscript_name) == 0)
+                const char *face_psname = FT_Get_Postscript_Name(face);
+                if (face_psname != NULL &&
+                    strcmp(face_psname, postscript_name) == 0)
                     break;
             }
         }