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

Issue 1394743002: Relax the check on 0 length streams. (Closed)

Created:
5 years, 2 months ago by Lei Zhang
Modified:
5 years, 2 months ago
Reviewers:
Tom Sepez, jun_fang
CC:
pdfium-reviews_googlegroups.com, kai_jing, steven_wu
Base URL:
https://pdfium.googlesource.com/pdfium@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Relax the check on 0 length streams. CPDF_SyntaxParser::ReadStream() originally created stream objects when the length is 0. Commit 2526930 tightened the constraint and returned NULL. This has some adverse affects, as seen in Chromium's print preview of PDFs. Instead, relax the constraint a little so when the length is 0, return a CPDF_Stream with NULL data and size 0. BUG=531835 Committed: https://pdfium.googlesource.com/pdfium/+/4fa0e27ba39f49ba92fb4c160ab836a6f1dd2893

Patch Set 1 #

Total comments: 4

Patch Set 2 : Only use pCryptoHandler when there is data #

Patch Set 3 : relax another len <= 0 check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -14 lines) Patch
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 1 chunk +17 lines, -14 lines 0 comments Download

Messages

Total messages: 10 (1 generated)
Lei Zhang
5 years, 2 months ago (2015-10-08 03:04:43 UTC) #2
jun_fang
https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode2524 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:2524: if (len <= 0) { Relax too? https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode2539 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:2539: ...
5 years, 2 months ago (2015-10-08 09:19:52 UTC) #3
Lei Zhang
https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode2539 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:2539: if (pCryptoHandler) { On 2015/10/08 09:19:52, jun_fang wrote: > ...
5 years, 2 months ago (2015-10-08 17:21:49 UTC) #4
Lei Zhang
https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1394743002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode2524 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:2524: if (len <= 0) { On 2015/10/08 09:19:52, jun_fang ...
5 years, 2 months ago (2015-10-08 17:33:08 UTC) #5
Lei Zhang
All the tests pass locally for me. I'm going to land patch set 3. Please ...
5 years, 2 months ago (2015-10-08 17:34:13 UTC) #6
Lei Zhang
AKA TBR
5 years, 2 months ago (2015-10-08 17:34:23 UTC) #7
Lei Zhang
Committed patchset #3 (id:40001) manually as 4fa0e27ba39f49ba92fb4c160ab836a6f1dd2893 (presubmit successful).
5 years, 2 months ago (2015-10-08 17:34:34 UTC) #8
jun_fang
On 2015/10/08 17:34:34, Lei Zhang wrote: > Committed patchset #3 (id:40001) manually as > 4fa0e27ba39f49ba92fb4c160ab836a6f1dd2893 ...
5 years, 2 months ago (2015-10-09 02:25:03 UTC) #9
jun_fang
5 years, 2 months ago (2015-10-09 02:25:04 UTC) #10
Message was sent while issue was closed.
On 2015/10/08 17:34:34, Lei Zhang wrote:
> Committed patchset #3 (id:40001) manually as
> 4fa0e27ba39f49ba92fb4c160ab836a6f1dd2893 (presubmit successful).

LGTM.

Powered by Google App Engine
This is Rietveld 408576698