title: PDF.js Unable to decode image "xxx": RangeError: Array buffer allocation failed
body: <p>I want to display a pdf with pdf.js. On Windows10 with the Chrome Browser 94.0.4606.61 (64-Bit) the  pdf shows up correctly, but on a raspberry Pi 4, Raspbian 10 32Bit with the Chromium Browser 92.0.4515.98 the same pdf won't show up correct (a big image on the pdf is not there). In the console log these two errors appears:</p>
  <ul>
  <li>Warning: Unable to decode image &quot;img_p0_1&quot;: &quot;Range Error: Array
  buffer allocation failed&quot;</li>
  <li>Warning: Dependent image isn't ready yet</li>
  </ul>
  <p>Anybody an idea why the PDF is correct in Chrome on Windows but not on the Raspbery Pi on Chromium?</p>
  <p>I use this example code:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
      &lt;head&gt;
          &lt;meta charset=&quot;utf-8&quot;&gt;
          &lt;title&gt;Test&lt;/title&gt;
          &lt;meta name=&quot;description&quot; content=&quot;Testing pdf.js&quot;&gt;
          &lt;meta name=&quot;author&quot; content=&quot;GramThanos&quot;&gt;
  
          &lt;!-- hack code --&gt;
          &lt;base href=&quot;https://mozilla.github.io&quot;&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script src=&quot;//mozilla.github.io/pdf.js/build/pdf.js&quot;&gt;&lt;/script&gt;
  
          &lt;h1&gt;PDF.js 'Hello, world!' example&lt;/h1&gt;
  
          &lt;canvas id=&quot;the-canvas&quot;&gt;&lt;/canvas&gt;
  
          &lt;script type=&quot;text/javascript&quot;&gt;
              // If absolute URL from the remote server is provided, configure the CORS
              // header on that server.
              var url = './d1.pdf';
  
              // Loaded via &lt;script&gt; tag, create shortcut to access PDF.js exports.
              var pdfjsLib = window['pdfjs-dist/build/pdf'];
  
              // The workerSrc property shall be specified.
              pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
  
              // Asynchronous download of PDF
              var loadingTask = pdfjsLib.getDocument(url);
              loadingTask.promise.then(function(pdf) {
                console.log('PDF loaded');
  
                // Fetch the first page
                var pageNumber = 1;
                pdf.getPage(pageNumber).then(function(page) {
                  console.log('Page loaded');
  
                  var scale = 1.5;
                  var viewport = page.getViewport({scale: scale});
  
                  // Prepare canvas using PDF page dimensions
                  var canvas = document.getElementById('the-canvas');
                  var context = canvas.getContext('2d');
                  canvas.height = viewport.height;
                  canvas.width = viewport.width;
  
                  // Render PDF page into canvas context
                  var renderContext = {
                    canvasContext: context,
                    viewport: viewport
                  };
                  var renderTask = page.render(renderContext);
                  renderTask.promise.then(function () {
                    console.log('Page rendered');
                  });
                });
              }, function (reason) {
                // PDF loading error
                console.error(reason);
              });
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>