Attach (recommended) or Link to PDF file here:
[compressed.tracemonkey-pldi-09.pdf](https://github.com/mozilla/pdf.js/files/7846269/compressed.tracemonkey-pldi-09.pdf)


Configuration:
- Web browser and its version: chrome v97.0.4692.7
- Operating system and its version: macOS 10.15.7
- PDF.js version: 2.12.313
- Is a browser extension: no

Steps to reproduce the problem:
1. https://github.com/mozilla/pdf.js/blob/236c8d47864e8ebf593bae21576670b59a7d4988/src/display/base_factory.js#L146-L149
2. https://github.com/mozilla/pdf.js/blob/236c8d47864e8ebf593bae21576670b59a7d4988/src/display/annotation_layer.js#L2073-L2081
3. As in the code above, sometimes 'data.rect' is '[0,0,0,0]', which causes 'this.svgFactory.create' to throw an error, which makes the following for loop stop working. https://github.com/mozilla/pdf.js/blob/236c8d47864e8ebf593bae21576670b59a7d4988/src/display/annotation_layer.js#L2352-L2371


const rect = Util.normalizeRect([
      data.rect[0],
      page.view[3] - data.rect[1] + page.view[1],
      data.rect[2],
      page.view[3] - data.rect[3] + page.view[1],
    ]);
    if (data.hasOwnCanvas) {
      const transform = viewport.transform.slice();
      const [scaleX, scaleY] = Util.singularValueDecompose2dScale(transform);
      width = Math.ceil(width * scaleX);
      height = Math.ceil(height * scaleY);
      rect[0] *= scaleX;
      rect[1] *= scaleY;
      
      
      
      
      for (let i = 0; i < 4; i++) {
        transform[i] = Math.sign(transform[i]);
      }
      container.style.transform = `matrix(${transform.join(",")})`;
    } else {
      container.style.transform = `matrix(${viewport.transform.join(",")})`;
    }
    container.style.transformOrigin = `${-rect[0]}px ${-rect[1]}px`;
    if (!ignoreBorder && data.borderStyle.width > 0) {
      container.style.borderWidth = `${data.borderStyle.width}px`;
      if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) {