Found an out of bounds index in Line 555: node_modules/pdfjs-dist/web/pdf_viewer.js
in function backtrackBeforeAllVisibleElements
:
Here is the file containing backtrackBeforeAllVisibleElements
: https://github.com/mozilla/pdf.js/blob/7e139776692789fee4b2cedb443715665c5adebe/web/ui_utils.js
Adding in views.length <= index
:
function backtrackBeforeAllVisibleElements(index, views, top) {
if (index < 2 || views.length <= index) { <<<<< HERE
return index;
}
var elt = views[index].div;
This fixes an out of bounds problem in ng2-pdf-viewer
with a 3page pdf we have. Described here:
https://github.com/VadimDez/ng2-pdf-viewer/issues/367#issuecomment-414696693
Is this something we can get into npm pdfjs-dist
?
Please refer to #9895, and in particular https://github.com/mozilla/pdf.js/pull/9895#issuecomment-405515206.
@Snuffleupagus this is now happening with the pdfjs-dist again after the upgrade to the 2.0.943 and it is not related to the ng2-something