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.

tables.cmap,
        font,
        this.isSymbolicFont,
        properties.hasEncoding
      );
      const cmapPlatformId = cmapTable.platformId;
      const cmapEncodingId = cmapTable.encodingId;
      const cmapMappings = cmapTable.mappings;
      const cmapMappingsLength = cmapMappings.length;
      let baseEncoding = [];
      if (
        properties.hasEncoding &&
        (properties.baseEncodingName === "MacRomanEncoding" ||
          properties.baseEncodingName === "WinAnsiEncoding")
      ) {
        baseEncoding = getEncoding(properties.baseEncodingName);
      }
      
      
      
      if (
        properties.hasEncoding &&
        !this.isSymbolicFont &&
        ((cmapPlatformId === 3 && cmapEncodingId === 1) ||
          (cmapPlatformId === 1 && cmapEncodingId === 0))
      ) {
        const glyphsUnicodeMap = getGlyphsUnicode();
        for (let charCode = 0; charCode < 256; charCode++) {
          let glyphName;
          if (this.differences[charCode] !== undefined) {