Bug 691349

Summary: pdf_loadobjstm: don't overwrite object reference in xref with older version
Product: MuPDF Reporter: zeniko
Component: mupdfAssignee: Tor Andersson <tor.andersson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Windows 7   
URL: http://code.google.com/p/sumatrapdf/issues/detail?id=926
Customer: Word Size: ---

Description zeniko 2010-05-29 21:35:15 UTC
Steps to reproduce:
* Load http://mobile.carrefour.fr/pdf/guide-achat.pdf at page 1 and navigate to page 4.
* Load the same document directly at page 4 and navigate to page 6.

Actual results:
In the first case, many letters are missing from page 4 due to an incomplete (older revision) of a partial font being loaded.
In the second case, page 4 renders just fine but the same issue applies to page 6.

See http://code.google.com/p/sumatrapdf/source/detail?r=1922 for a patch.
Comment 1 zeniko 2010-05-29 22:28:29 UTC
Well, http://code.google.com/p/sumatrapdf/source/detail?r=1923 would be the version which actually works...
Comment 2 zeniko 2010-05-29 23:05:04 UTC
A variation of the same issue can be found at http://drop.io/mdj12345 (from http://code.google.com/p/sumatrapdf/issues/detail?id=936 ): in this document, the object numbers of old xrefs are re-used, but due to the fact that pdf_readnewxref works backwards, the table entries are overwritten nonetheless.

See http://code.google.com/p/sumatrapdf/source/detail?r=1924 for a patch for this second issue.
Comment 3 Tor Andersson 2010-05-31 20:49:41 UTC
I've pushed patches that fix the xref table clobbering in both of these cases.
Comment 4 zeniko 2010-05-31 21:17:43 UTC
FYI: Your first fix introduced a memory leak due to unused objects not being dropped.