Merge pull request #14386 from Snuffleupagus/issue-14385

Ignore *negative* /FitH parameters in the viewer (issue 14385)
This commit is contained in:
Tim van der Meij 2021-12-18 13:24:42 +01:00 committed by GitHub
commit afa43d3af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1173,7 +1173,7 @@ class BaseViewer {
if (y === null && this._location) {
x = this._location.left;
y = this._location.top;
} else if (typeof y !== "number") {
} else if (typeof y !== "number" || y < 0) {
// The "top" value isn't optional, according to the spec, however some
// bad PDF generators will pretend that it is (fixes bug 1663390).
y = pageHeight;