Don't crash in FcPatternDestroy with NULL pattern

This commit is contained in:
Behdad Esfahbod 2013-01-01 20:20:12 -06:00
parent e7d3e21632
commit c9581b47c4
1 changed files with 3 additions and 0 deletions

View File

@ -359,6 +359,9 @@ FcPatternDestroy (FcPattern *p)
int i; int i;
FcPatternElt *elts; FcPatternElt *elts;
if (!p)
return;
if (p->ref == FC_REF_CONSTANT) if (p->ref == FC_REF_CONSTANT)
{ {
FcCacheObjectDereference (p); FcCacheObjectDereference (p);