diff --git a/src/core/obj.js b/src/core/obj.js index 2037688d2f847..329880686bd3a 100644 --- a/src/core/obj.js +++ b/src/core/obj.js @@ -1051,12 +1051,13 @@ var XRef = (function XRefClosure() { trailers.push(position); position += skipUntil(buffer, position, startxrefBytes); } else if ((m = /^(\d+)\s+(\d+)\s+obj\b/.exec(token))) { - this.entries[m[1]] = { - offset: position, - gen: m[2] | 0, - uncompressed: true - }; - + if (typeof this.entries[m[1]] === 'undefined') { + this.entries[m[1]] = { + offset: position, + gen: m[2] | 0, + uncompressed: true + }; + } var contentLength = skipUntil(buffer, position, endobjBytes) + 7; var content = buffer.subarray(position, position + contentLength); diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index a744db6caffce..fc02e77bf98dd 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -122,3 +122,4 @@ !issue5481.pdf !issue5567.pdf !issue5701.pdf +!issue5909.pdf diff --git a/test/pdfs/issue5909.pdf b/test/pdfs/issue5909.pdf new file mode 100644 index 0000000000000..3b70aab2f4d3d Binary files /dev/null and b/test/pdfs/issue5909.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 4ddf669af62e0..81977a8eaf737 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -2080,5 +2080,11 @@ "md5": "d5b37f8bf1b3aafa1b4fcf19ebdc7c74", "rounds": 1, "type": "eq" + }, + { "id": "issue5909", + "file": "pdfs/issue5909.pdf", + "md5": "65c169b6f540b27ac0ff2738a80d1e14", + "rounds": 1, + "type": "eq" } ]