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

Merge pull request #11231 from Snuffleupagus/indexObjects-entries-gen

Allow over-writing entries, in `XRef.indexObjects`, only when the generation number matches (issues 11230, 11139, 9552, 9129, 7303)
This commit is contained in:
Tim van der Meij 2019-10-17 23:56:26 +02:00 committed by GitHub
commit c54bb222ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 1 deletions

View file

@ -1415,7 +1415,7 @@ var XRef = (function XRefClosure() {
position += skipUntil(buffer, position, startxrefBytes);
} else if ((m = objRegExp.exec(token))) {
const num = m[1] | 0, gen = m[2] | 0;
if (typeof this.entries[num] === 'undefined') {
if (!this.entries[num] || this.entries[num].gen === gen) {
this.entries[num] = {
offset: position - stream.start,
gen,