https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

if (!properties.cssFontInfo) {
      
      const newMapping = adjustMapping(
        charCodeToGlyphId,
        hasGlyph,
        glyphZeroId
      );
      this.toFontChar = newMapping.toFontChar;
      tables.cmap = {
        tag: "cmap",
        data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphsOut),
      };
      if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) {
        tables["OS/2"] = {
          tag: "OS/2",
          data: createOS2Table(
            properties,
            newMapping.charCodeToGlyphId,
            metricsOverride
          ),
        };
      }
    }
    if (!isTrueType) {
      try {
        
        cffFile = new Stream(tables["CFF "].data);
        const parser = new CFFParser(
          cffFile,