提交 0465e698 编写于 作者: B Behdad Esfahbod

Protect against NULL funcs

上级 5ceefa1d
...@@ -121,6 +121,9 @@ void ...@@ -121,6 +121,9 @@ void
hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
hb_unicode_funcs_t *unicode) hb_unicode_funcs_t *unicode)
{ {
if (!unicode)
unicode = &_hb_unicode_funcs_nil;
hb_unicode_funcs_reference (unicode); hb_unicode_funcs_reference (unicode);
hb_unicode_funcs_destroy (buffer->unicode); hb_unicode_funcs_destroy (buffer->unicode);
buffer->unicode = unicode; buffer->unicode = unicode;
......
...@@ -385,6 +385,9 @@ hb_font_set_funcs (hb_font_t *font, ...@@ -385,6 +385,9 @@ hb_font_set_funcs (hb_font_t *font,
if (font->destroy) if (font->destroy)
font->destroy (font->user_data); font->destroy (font->user_data);
if (!klass)
klass = &_hb_font_funcs_nil;
hb_font_funcs_reference (klass); hb_font_funcs_reference (klass);
hb_font_funcs_destroy (font->klass); hb_font_funcs_destroy (font->klass);
font->klass = klass; font->klass = klass;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册