Steps to reproduce (this PDF):
[page4.pdf](https://github.com/mozilla/pdf.js/files/5990272/page4.pdf)

````
npm install
node_modules/.bin/gulp dist-install
node examples/node/pdf2svg.js /tmp/page4.pdf
````

Error:
````
Error: Invalid SVG dimensions
    at unreachable (/tmp/pdf.js/build/dist/legacy/build/pdf.js:2086:9)
    at assert (/tmp/pdf.js/build/dist/legacy/build/pdf.js:2091:5)
    at DOMSVGFactory.create (/tmp/pdf.js/build/dist/legacy/build/pdf.js:640:24)
    at SVGGraphics._makeTilingPattern (/tmp/pdf.js/build/dist/legacy/build/pdf.js:24178:36)
    at SVGGraphics._makeColorN_Pattern (/tmp/pdf.js/build/dist/legacy/build/pdf.js:24127:23)
    at SVGGraphics.setFillColorN (/tmp/pdf.js/build/dist/legacy/build/pdf.js:24088:39)
    at SVGGraphics.executeOpTree (/tmp/pdf.js/build/dist/legacy/build/pdf.js:23634:22)
    at /tmp/pdf.js/build/dist/legacy/build/pdf.js:23508:18
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
````
const literals = new Uint8Array((1 + lineSize) * height);
      let offsetLiterals = 0,
        offsetBytes = 0;
      for (let y = 0; y < height; ++y) {
        literals[offsetLiterals++] = 0; 
        literals.set(
          bytes.subarray(offsetBytes, offsetBytes + lineSize),
          offsetLiterals
        );
        offsetBytes += lineSize;
        offsetLiterals += lineSize;
      }
      if (kind === ImageKind.GRAYSCALE_1BPP && isMask) {
        
        offsetLiterals = 0;
        for (let y = 0; y < height; y++) {
          offsetLiterals++; 
          for (let i = 0; i < lineSize; i++) {
            literals[offsetLiterals++] ^= 0xff;
          }
        }
      }
      const ihdr = new Uint8Array([
        (width >> 24) & 0xff,
        (width >> 16) & 0xff,
        (width >> 8) & 0xff,
        width & 0xff,
        (height >> 24) & 0xff,
        (height >> 16) & 0xff,
        (height >> 8) & 0xff,