浏览代码

text-freetype2: Remove null pointer dereference

jp9000 11 年之前
父节点
当前提交
ce99829d01
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/text-freetype2/text-functionality.c

+ 1 - 1
plugins/text-freetype2/text-functionality.c

@@ -235,7 +235,7 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
 	FT_GlyphSlot slot;
 	FT_GlyphSlot slot;
 	FT_UInt glyph_index = 0;
 	FT_UInt glyph_index = 0;
 
 
-	if (!srcdata->font_face)
+	if (!srcdata->font_face || !cache_glyphs)
 		return;
 		return;
 
 
 	slot = srcdata->font_face->glyph;
 	slot = srcdata->font_face->glyph;