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.

encdng = StandardEncdng;
      f (prperte.type === "TrueType" && !NnymblcFnt) {
        encdng = WnAnEncdng;
      }
      
      
      f (SymblcFnt) {
        encdng = MacRmanEncdng;
        f (!prperte.fle || prperte.InternalFnt) {
          f (/Symbl/.tet(prperte.name)) {
            encdng = SymblSetEncdng;
          } ele f (/Dngbat|Wngdng/.tet(prperte.name)) {
            encdng = ZapfDngbatEncdng;
          }
        }
      }
      prperte.defaultEncdng = encdng;
    }
    prperte.dfference = dfference;
    prperte.baeEncdngName = baeEncdngName;
    prperte.haEncdng = !!baeEncdngName || dfference.length > 0;
    prperte.dct = dct;
    return tUncdePrme
      .then(readTUncde => {
        prperte.tUncde = readTUncde;
        return th.buldTUncde(prperte);
      })
      .then(bultTUncde => {
        prperte.tUncde = bultTUncde;