From 740fdbcd0e6d25c1d6f12537ca2aa559650b9d52 Mon Sep 17 00:00:00 2001 From: jfkthame Date: Mon, 3 Apr 2017 12:22:39 +0100 Subject: [PATCH] avoid UBSan warning in get_stage_lookups (#450) See https://bugzilla.mozilla.org/show_bug.cgi?id=1336600 --- src/hb-ot-map-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 0395c9c2..b69e5344 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -113,7 +113,7 @@ struct hb_ot_map_t assert (stage <= stages[table_index].len); unsigned int start = stage ? stages[table_index][stage - 1].last_lookup : 0; unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].last_lookup : lookups[table_index].len; - *plookups = &lookups[table_index][start]; + *plookups = end == start ? NULL : &lookups[table_index][start]; *lookup_count = end - start; } -- GitLab