Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(841)

Issue 2437773003: Fix loading page using hint tables. (Closed)

Created:
4 years, 2 months ago by snake
Modified:
4 years, 1 month ago
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Fix loading page using hint tables. When linearized document have hint table, The FPDFAvail_IsPageAvail return true, but FPDF_LoadPage return nullptr, for non first pages. This happens, bacause document not use hint tables, to load page. To fix this, I force save the page's ObjNum in document. R=npm, dsinclair Committed: https://pdfium.googlesource.com/pdfium/+/ef38283688c1ee7c08bcf4204cfb78e09c039782

Patch Set 1 #

Patch Set 2 : Fix loading page using hint tables. #

Patch Set 3 : rebase and add test. #

Patch Set 4 : fix test. #

Total comments: 2

Patch Set 5 : fix compilation on linux. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -2 lines) Patch
M BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M core/fpdfapi/parser/cpdf_data_avail.cpp View 2 chunks +10 lines, -1 line 4 comments Download
M core/fpdfapi/parser/cpdf_document.cpp View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
A core/fpdfapi/parser/cpdf_document_unittest.cpp View 1 2 3 4 1 chunk +42 lines, -0 lines 1 comment Download

Messages

Total messages: 23 (9 generated)
snake
4 years, 2 months ago (2016-10-20 16:05:39 UTC) #1
dsinclair
Adding tsepez@ and thestig@ as they've looked into the hints table before I believe.
4 years, 2 months ago (2016-10-20 18:06:51 UTC) #3
Tom Sepez
On 2016/10/20 18:06:51, dsinclair wrote: > Adding tsepez@ and thestig@ as they've looked into the ...
4 years, 2 months ago (2016-10-20 18:15:59 UTC) #4
snake
On 2016/10/20 18:15:59, Tom Sepez wrote: > On 2016/10/20 18:06:51, dsinclair wrote: > > Adding ...
4 years, 2 months ago (2016-10-20 18:26:21 UTC) #5
Tom Sepez
> What problem with cpdf_document.cpp ?? Now i found, that it have incorrect > mapping ...
4 years, 2 months ago (2016-10-20 18:32:16 UTC) #6
snake
On 2016/10/20 18:32:16, Tom Sepez wrote: > > What problem with cpdf_document.cpp ?? Now i ...
4 years, 2 months ago (2016-10-20 19:38:12 UTC) #7
Tom Sepez
lgtm
4 years, 2 months ago (2016-10-20 20:03:54 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2437773003/80001
4 years, 2 months ago (2016-10-20 20:20:51 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://pdfium.googlesource.com/pdfium/+/ef38283688c1ee7c08bcf4204cfb78e09c039782
4 years, 2 months ago (2016-10-20 20:29:48 UTC) #18
Lei Zhang
https://codereview.chromium.org/2437773003/diff/60001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (right): https://codereview.chromium.org/2437773003/diff/60001/core/fpdfapi/parser/cpdf_document.cpp#newcode428 core/fpdfapi/parser/cpdf_document.cpp:428: if (CPDF_ModuleMgr::Get()->GetPageModule()) { Is this to work around the ...
4 years, 2 months ago (2016-10-20 21:18:43 UTC) #19
Lei Zhang
https://codereview.chromium.org/2437773003/diff/60001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (right): https://codereview.chromium.org/2437773003/diff/60001/core/fpdfapi/parser/cpdf_document.cpp#newcode428 core/fpdfapi/parser/cpdf_document.cpp:428: if (CPDF_ModuleMgr::Get()->GetPageModule()) { On 2016/10/20 21:18:43, Lei Zhang wrote: ...
4 years, 2 months ago (2016-10-20 21:43:36 UTC) #20
npm
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2442663005/ by npm@chromium.org. ...
4 years, 2 months ago (2016-10-21 16:42:20 UTC) #21
Lei Zhang
https://codereview.chromium.org/2437773003/diff/80001/core/fpdfapi/parser/cpdf_data_avail.cpp File core/fpdfapi/parser/cpdf_data_avail.cpp (right): https://codereview.chromium.org/2437773003/diff/80001/core/fpdfapi/parser/cpdf_data_avail.cpp#newcode1629 core/fpdfapi/parser/cpdf_data_avail.cpp:1629: m_pDocument->SetPageObjNum(dwPage, GetPage(dwPage)->GetObjNum()); On 2016/10/20 21:43:36, Lei Zhang wrote: > ...
4 years, 2 months ago (2016-10-21 17:15:53 UTC) #22
snake
4 years, 1 month ago (2016-10-24 15:38:31 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/2437773003/diff/80001/core/fpdfapi/parser/cpd...
File core/fpdfapi/parser/cpdf_data_avail.cpp (right):

https://codereview.chromium.org/2437773003/diff/80001/core/fpdfapi/parser/cpd...
core/fpdfapi/parser/cpdf_data_avail.cpp:1629: m_pDocument->SetPageObjNum(dwPage,
GetPage(dwPage)->GetObjNum());
On 2016/10/21 17:15:53, Lei Zhang wrote:
> On 2016/10/20 21:43:36, Lei Zhang wrote:
> > Can GetPage() return a nullptr here?
> 
> Based on the new crashes that caused this revert... yes, it can.

But should not, because the page should be available at this moment.

Powered by Google App Engine
This is Rietveld 408576698