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.

const header = file.peekBytes(4);
  if (
     header[0] >= 1 &&
    
    
     header[3] >= 1 &&
    header[3] <= 4
  ) {
    return true;
  }
  return false;
}
function getFontFileType(file, { type, subtype, composite }) {
  let fileType, fileSubtype;
  if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) {
    if (composite) {
      fileType = "CIDFontType2";
    } else {