提交 255df680 编写于 作者: B Behdad Esfahbod

Fix undefined behavior in cmp function

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93274
上级 fcf9e61b
...@@ -203,7 +203,8 @@ struct hb_ot_map_builder_t ...@@ -203,7 +203,8 @@ struct hb_ot_map_builder_t
unsigned int stage[2]; /* GSUB/GPOS */ unsigned int stage[2]; /* GSUB/GPOS */
static int cmp (const feature_info_t *a, const feature_info_t *b) static int cmp (const feature_info_t *a, const feature_info_t *b)
{ return (a->tag != b->tag) ? (a->tag < b->tag ? -1 : 1) : (a->seq < b->seq ? -1 : 1); } { return (a->tag != b->tag) ? (a->tag < b->tag ? -1 : 1) :
(a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0); }
}; };
struct stage_info_t { struct stage_info_t {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册