
Attach (recommended) or Link to PDF file here:
[NAPEN16171380959.pdf](https://github.com/mozilla/pdf.js/files/6143802/NAPEN16171380959.pdf)

Configuration:
- Web browser and its version: Firefox 88 Nightly
- Operating system and its version: Windows 10
- PDF.js version:
- Is a browser extension: No

What went wrong? (add screenshot)
![](https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2021-03-15-10-58-27-ce2796.png)


var i, j;
        const locaEntries = [];
        
        for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) {
          let offset = itemDecode(locaData, j);
          if (offset > oldGlyfDataLength) {
            offset = oldGlyfDataLength;
          }
          locaEntries.push({
            index: i,
            offset,
            endOffset: 0,
          });
        }
        locaEntries.sort((a, b) => {
          return a.offset - b.offset;
        });
        
        
        
        for (i = 0; i < numGlyphs; i++) {
          locaEntries[i].endOffset = locaEntries[i + 1].offset;
        }
        
        locaEntries.sort((a, b) => {
          return a.index - b.index;
        });
        var missingGlyphs = Object.create(null);
        var writeOffset = 0;
        itemEncode(locaData, 0, writeOffset);