提交 13b2b963 编写于 作者: B Behdad Esfahbod 提交者: Behdad Esfahbod

Bug 488840 – harfbuzz: protect against ligid overflow

2007-10-21  Behdad Esfahbod  <behdad@gnome.org>

        Bug 488840 – harfbuzz: protect against ligid overflow

        * pango/opentype/harfbuzz-buffer.c (_hb_buffer_allocate_ligid):
        Never return zero, even in case of overflow.

        * pango/opentype/harfbuzz-impl.h: Define dummy HB_LIKELY() and
        HB_UNLIKELY(), to be filled later.
上级 6b347138
......@@ -356,5 +356,9 @@ _hb_buffer_replace_output_glyph( HB_Buffer buffer,
HB_INTERNAL FT_UShort
_hb_buffer_allocate_ligid( HB_Buffer buffer )
{
return ++buffer->max_ligID;
buffer->max_ligID++;
if (HB_UNLIKELY (buffer->max_ligID == 0))
buffer->max_ligID++;
return buffer->max_ligID;
}
......@@ -49,6 +49,9 @@ FT_BEGIN_HEADER
# define FT_UNUSED(arg) ((arg) = (arg))
#endif
#define HB_LIKELY(cond) (cond)
#define HB_UNLIKELY(cond) (cond)
#include "ftglue.h"
#define ARRAY_LEN(Array) ((int)(sizeof (Array) / sizeof (Array)[0]))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册