Bug 1257517 - Restore accidentally-removed zero check for non-default UVS offset. r=jfkthame, a=lizzard
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Fri, 18 Mar 2016 21:43:39 +0900
changeset 317594 9d60fba2210c9b0c8c51c7267fcbcec21c9b489a
parent 317593 af626ca9a75b0fc157ac61a1f651014e11fefd7b
child 317595 2625bab7fcef96d3f9bee3a7d97df7515dde3ae4
push id5802
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 14:26:03 +0000
treeherdermozilla-beta@40e8d9bdedb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, lizzard
bugs1257517
milestone46.0
Bug 1257517 - Restore accidentally-removed zero check for non-default UVS offset. r=jfkthame, a=lizzard
gfx/thebes/gfxFontUtils.cpp
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -726,16 +726,20 @@ gfxFontUtils::MapUVSToGlyphFormat14(cons
 
     size_t index;
     if (!BinarySearch(Format14CmapWrapper(*cmap14),
                       0, cmap14->numVarSelectorRecords, aVS, &index)) {
         return 0;
     }
 
     const uint32_t nonDefUVSOffset = cmap14->varSelectorRecords[index].nonDefaultUVSOffset;
+    if (!nonDefUVSOffset) {
+        return 0;
+    }
+
     const NonDefUVSTable *table = reinterpret_cast<const NonDefUVSTable*>
                                       (aBuf + nonDefUVSOffset);
 
     if (BinarySearch(NonDefUVSTableWrapper(*table), 0, table->numUVSMappings,
                      aCh, &index)) {
         return table->uvsMappings[index].glyphID;
     }