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

Issue 1406943005: Clear decoders after the image decoder in the /Filter array (Closed)

Created:
5 years, 1 month ago by Oliver Chang
Modified:
5 years, 1 month ago
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Clear decoders after the image decoder in the /Filter array. During decoding, when an image decoder is encountered, any subsequent decoders are ignored, but remain in the array. However, later on CPDF_DIBSource::ValidateDictParam expects the image decoder to be the last in the array, causing issues. A check is also added in CPDF_DIBSource::GetScanline to ensure that the calculated pitch value is <= the (4-aligned) pitch value in the cached bitmap to prevent future issues. Also cleans up some NULL usages. BUG=552046 R=jun_fang@foxitsoftware.com, tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/182d129bcee8f7731b9bbfde0064295ad3b37271

Patch Set 1 : #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 5

Patch Set 4 : Crypt #

Patch Set 5 : Different approach #

Patch Set 6 : #

Total comments: 2

Patch Set 7 : address comments (also rebases) #

Total comments: 4

Patch Set 8 : nit #

Patch Set 9 : back to "<=" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -15 lines) Patch
M core/include/fpdfapi/fpdf_objects.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp View 1 2 3 4 3 chunks +7 lines, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp View 1 2 3 4 5 6 7 1 chunk +10 lines, -5 lines 0 comments Download
M core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -5 lines 0 comments Download
A testing/resources/bug_552046.in View 1 2 3 4 Binary file 0 comments Download
A testing/resources/bug_552046.pdf View 1 2 3 4 Binary file 0 comments Download

Messages

Total messages: 36 (16 generated)
Oliver Chang
ptal.
5 years, 1 month ago (2015-11-06 23:09:32 UTC) #6
Oliver Chang
not 100% sure if this is the correct fix here. suggestions are welcome.
5 years, 1 month ago (2015-11-06 23:11:08 UTC) #7
Tom Sepez
+jun because it deals with core pdf behaviour.
5 years, 1 month ago (2015-11-06 23:16:05 UTC) #9
jun_fang
https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp:397: } else if (i == DecoderList.GetSize() - 1) { ...
5 years, 1 month ago (2015-11-09 11:09:35 UTC) #10
Oliver Chang
https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp:397: } else if (i == DecoderList.GetSize() - 1) { ...
5 years, 1 month ago (2015-11-09 20:41:23 UTC) #11
Oliver Chang
On 2015/11/09 20:41:23, Oliver Chang wrote: > https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp > File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): > > https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 ...
5 years, 1 month ago (2015-11-09 21:32:28 UTC) #12
Oliver Chang
Jun, friendly ping.
5 years, 1 month ago (2015-11-10 22:20:46 UTC) #13
jun_fang
https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp:397: } else if (i == DecoderList.GetSize() - 1) { ...
5 years, 1 month ago (2015-11-11 10:10:36 UTC) #14
jun_fang
https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp:397: } else if (i == DecoderList.GetSize() - 1) { ...
5 years, 1 month ago (2015-11-11 10:13:39 UTC) #15
Oliver Chang
https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp (right): https://codereview.chromium.org/1406943005/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp#newcode397 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp:397: } else if (i == DecoderList.GetSize() - 1) { ...
5 years, 1 month ago (2015-11-11 17:25:19 UTC) #16
Oliver Chang
Jun, please see latest patchset when you get the chance. I'm not completely sure if ...
5 years, 1 month ago (2015-11-11 22:50:16 UTC) #17
jun_fang
On 2015/11/11 22:50:16, Oliver Chang wrote: > Jun, please see latest patchset when you get ...
5 years, 1 month ago (2015-11-12 05:23:40 UTC) #18
jun_fang
On 2015/11/12 05:23:40, jun_fang wrote: > On 2015/11/11 22:50:16, Oliver Chang wrote: > > Jun, ...
5 years, 1 month ago (2015-11-12 05:35:28 UTC) #19
Oliver Chang
On 2015/11/12 05:35:28, jun_fang wrote: > On 2015/11/12 05:23:40, jun_fang wrote: > > On 2015/11/11 ...
5 years, 1 month ago (2015-11-12 05:38:33 UTC) #20
jun_fang
https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode1092 core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp:1092: if (m_pCachedBitmap && src_pitch_value <= m_pCachedBitmap->GetPitch()) { src_pitch_value should ...
5 years, 1 month ago (2015-11-12 05:41:07 UTC) #21
jun_fang
On 2015/11/12 05:41:07, jun_fang wrote: > https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp > File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): > > https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode1092 > ...
5 years, 1 month ago (2015-11-12 08:51:12 UTC) #28
Oliver Chang
On 2015/11/12 08:51:12, jun_fang wrote: > On 2015/11/12 05:41:07, jun_fang wrote: > > > https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ...
5 years, 1 month ago (2015-11-12 16:59:23 UTC) #29
Tom Sepez
lgtm https://codereview.chromium.org/1406943005/diff/180001/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp (right): https://codereview.chromium.org/1406943005/diff/180001/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp#newcode500 core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp:500: ASSERT(IsArray()); nit: probably pointless given that we've cleaned ...
5 years, 1 month ago (2015-11-12 17:39:19 UTC) #30
Oliver Chang
https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp File core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp (right): https://codereview.chromium.org/1406943005/diff/120001/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp#newcode1092 core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp:1092: if (m_pCachedBitmap && src_pitch_value <= m_pCachedBitmap->GetPitch()) { On 2015/11/12 ...
5 years, 1 month ago (2015-11-12 18:39:45 UTC) #33
Oliver Chang
5 years, 1 month ago (2015-11-12 18:43:34 UTC) #36
Message was sent while issue was closed.
Committed patchset #9 (id:220001) manually as
182d129bcee8f7731b9bbfde0064295ad3b37271 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698