Bug 1624225 - Don't reject 'fvar' table in a variation font if no instance records are present, as the font is still valid. r=lsalzman
authorJonathan Kew <jkew@mozilla.com>
Sun, 22 Mar 2020 21:12:41 +0000
changeset 520035 0af3b4b7bd51c329cca240184c1f2a214240612a
parent 520034 9f3f88599fffa54ddf0c744b98cc02df99f8d0b8
child 520036 8ad0baa40526df79d54f8992a6fca32521feb87f
push id110815
push userjkew@mozilla.com
push dateSun, 22 Mar 2020 21:43:36 +0000
treeherderautoland@0af3b4b7bd51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1624225
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1624225 - Don't reject 'fvar' table in a variation font if no instance records are present, as the font is still valid. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D67785
gfx/thebes/gfxFontUtils.cpp
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -1807,17 +1807,16 @@ void gfxFontUtils::GetVariationData(
   uint16_t axisCount = fvar->axisCount;
   uint16_t axisSize = fvar->axisSize;
   uint16_t instanceCount = fvar->instanceCount;
   uint16_t instanceSize = fvar->instanceSize;
   if (axisCount ==
           0 ||  // no axes?
                 // https://www.microsoft.com/typography/otspec/fvar.htm#axisSize
       axisSize != 20 ||      // required value for current table version
-      instanceCount == 0 ||  // no instances?
       // https://www.microsoft.com/typography/otspec/fvar.htm#instanceSize
       (instanceSize != axisCount * sizeof(int32_t) + 4 &&
        instanceSize != axisCount * sizeof(int32_t) + 6)) {
     return;
   }
   // Check that axis array will not exceed table size
   uint16_t axesOffset = fvar->axesArrayOffset;
   if (axesOffset + uint32_t(axisCount) * axisSize > len) {