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

Issue 1433423002: Fix extraction of colour components in CPDF_DIBSource::DownSampleScanline32Bit (Closed)

Created:
5 years, 1 month ago by Oliver Chang
Modified:
5 years, 1 month ago
Reviewers:
Tom Sepez, Lei Zhang
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

(Reland) Fix extraction of colour components in CPDF_DIBSource::DownSampleScanline32Bit Previously, if |m_bpc| was < 8 (e.g. 4), this function may still try to access the source components as if |m_bpc| == 8. Even when it fell into the codepath that tried to do the right thing in this case, it was wrong. BUG=554151 R=tsepez@chromium.org, thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/9b99615806e358fdb396d1cb162ee2e69c2a20ec Committed: https://pdfium.googlesource.com/pdfium/+/e21fe98d5b5da7da01503b985b07b90c8e811689

Patch Set 1 #

Total comments: 10

Patch Set 2 : address comments #

Total comments: 1

Patch Set 3 : semicolon #

Patch Set 4 : fix windows build #

Patch Set 5 : delete unwanted change #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -36 lines) Patch
M BUILD.gn View 1 2 3 4 2 chunks +2 lines, -1 line 1 comment Download
M core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 1 2 3 6 chunks +38 lines, -29 lines 0 comments Download
A + core/src/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp View 1 chunk +5 lines, -6 lines 0 comments Download
M pdfium.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A testing/resources/bug_554151.in View 1 chunk +59 lines, -0 lines 0 comments Download
A testing/resources/bug_554151.pdf View 1 2 3 4 1 chunk +70 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
Oliver Chang
ptal
5 years, 1 month ago (2015-11-11 18:42:28 UTC) #3
Tom Sepez
https://codereview.chromium.org/1433423002/diff/1/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): https://codereview.chromium.org/1433423002/diff/1/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode22 core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp:22: unsigned int _GetBits8(const uint8_t* pData, size_t bitpos, size_t nbits) ...
5 years, 1 month ago (2015-11-11 21:09:45 UTC) #4
Tom Sepez
> https://codereview.chromium.org/1433423002/diff/1/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode1470 > core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp:1470: > I think there's a problem with {} nesting, I'd expect ...
5 years, 1 month ago (2015-11-11 21:39:09 UTC) #5
Tom Sepez
Anyways, I think the code is correct, so LGTM after adding the assert, and you ...
5 years, 1 month ago (2015-11-11 21:43:02 UTC) #6
Oliver Chang
thanks for the review! will address the follow-ups in separate CL(s) when I get the ...
5 years, 1 month ago (2015-11-11 22:30:59 UTC) #7
Tom Sepez
https://codereview.chromium.org/1433423002/diff/20001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): https://codereview.chromium.org/1433423002/diff/20001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode998 core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp:998: int R = GetBits8(src_scan, src_bit_pos, m_bpc); Just noticed this: ...
5 years, 1 month ago (2015-11-11 23:33:59 UTC) #8
Tom Sepez
On 2015/11/11 23:33:59, Tom Sepez wrote: > https://codereview.chromium.org/1433423002/diff/20001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp > File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): > > https://codereview.chromium.org/1433423002/diff/20001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode998 ...
5 years, 1 month ago (2015-11-11 23:37:13 UTC) #9
Oliver Chang
On 2015/11/11 23:37:13, Tom Sepez wrote: > On 2015/11/11 23:33:59, Tom Sepez wrote: > > ...
5 years, 1 month ago (2015-11-11 23:38:10 UTC) #10
Oliver Chang
Committed patchset #3 (id:40001) manually as 9b99615806e358fdb396d1cb162ee2e69c2a20ec (presubmit successful).
5 years, 1 month ago (2015-11-11 23:46:31 UTC) #11
Oliver Chang
Committed patchset #5 (id:80001) manually as e21fe98d5b5da7da01503b985b07b90c8e811689 (presubmit successful).
5 years, 1 month ago (2015-11-12 00:04:04 UTC) #13
Lei Zhang
https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn File BUILD.gn (right): https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn#newcode156 BUILD.gn:156: 'testing/utils/path_service.cpp', This is a bad merge, and now the ...
5 years, 1 month ago (2015-11-12 23:42:22 UTC) #15
Lei Zhang
On 2015/11/12 23:42:22, Lei Zhang wrote: > https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn > File BUILD.gn (right): > > https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn#newcode156 ...
5 years, 1 month ago (2015-11-12 23:44:31 UTC) #16
Oliver Chang
5 years, 1 month ago (2015-11-12 23:45:55 UTC) #17
Message was sent while issue was closed.
On 2015/11/12 23:44:31, Lei Zhang wrote:
> On 2015/11/12 23:42:22, Lei Zhang wrote:
> > https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn
> > File BUILD.gn (right):
> > 
> > https://codereview.chromium.org/1433423002/diff/80001/BUILD.gn#newcode156
> > BUILD.gn:156: 'testing/utils/path_service.cpp',
> > This is a bad merge, and now the PDFium DEPS roll is failing. Please fix it
> and
> > I'll try rolling DEPS again.
> 
> Basically https://codereview.chromium.org/1419763005 got reverted. :-P

Oh my bad, must've derped when rebasing this CL.

Powered by Google App Engine
This is Rietveld 408576698