1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Restore a weaker version of the /Pages dictionary /Count check for corrupt documents (PR 15593 follow-up)

It appears that PR 15593 broke `issue12402`, and we thus need to partially restore the /Count check.
 I completely missed this when looking at the test-results for PR 15593, both locally and on the bots, since the `Driver._getLastPageNumber` method would "swallow" an unavailable page number.
This commit is contained in:
Jonas Jenwald 2022-10-20 14:15:58 +02:00
parent 36967fcedb
commit e591378ff1
2 changed files with 7 additions and 6 deletions

View file

@ -553,11 +553,7 @@ class Driver {
if (!task.pdfDoc) {
return task.firstPage || 1;
}
let lastPageNumber = task.lastPage || 0;
if (!lastPageNumber || lastPageNumber > task.pdfDoc.numPages) {
lastPageNumber = task.pdfDoc.numPages;
}
return lastPageNumber;
return task.lastPage || task.pdfDoc.numPages;
}
_nextPage(task, loadError) {