From 500737e8e16dce5248aff394899bb3761a9c3bbf Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 4 Jun 2014 18:17:29 -0400 Subject: [PATCH] [ot-font] Don't select a Null cmap subtable Can happen either in broken fonts, or as a result of sanitize(). --- src/hb-ot-cmap-table.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index b0f01e120..abaceaadf 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -354,7 +354,7 @@ struct cmap key.encodingID.set (encoding_id); int result = encodingRecord.search (key); - if (result == -1) + if (result == -1 || !encodingRecord[result].subtable) return NULL; return &(this+encodingRecord[result].subtable);