Age | Commit message (Collapse) | Author |
|
Change-Id: Id37333ba61ad0d395055acffd75d4d8be5eb2b3e
Reviewed-on: https://pdfium-review.googlesource.com/32911
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:234
Change-Id: Ia3e758bbe5c445c3856f5215e900e02a16b4d7d7
Reviewed-on: https://pdfium-review.googlesource.com/32910
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id7bf252ebe25c92d26065d1138a445ebb2f78d0b
Reviewed-on: https://pdfium-review.googlesource.com/32187
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
CFX_BitStream::GetBits() got refactored recently, with an assert to not
read 0 bits. A fuzzer then discovered code that is trying to do that.
BUG=chromium:846394
Change-Id: Ib18b47200c82aab369109b5911540db724172690
Reviewed-on: https://pdfium-review.googlesource.com/32934
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Replace it with CFX_BitStream.
Change-Id: Ib74657f888b8dec8b6fdad7b49e28d250991c590
Reviewed-on: https://pdfium-review.googlesource.com/32852
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also make destructors private for RetainPtr sub-classes, and add missing
destructors.
Change-Id: I451bf0aae2dae943b1f450d0aa4ca5124dc578fd
Reviewed-on: https://pdfium-review.googlesource.com/32853
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Fix some nits in CPDF_ShadingPattern as well.
Change-Id: I6b4b73f99031733a113fe2ad1bdc1d1e565b7a7d
Reviewed-on: https://pdfium-review.googlesource.com/32738
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Import Chromium's base/compiler_specific.h from r537069.
Now that FALLTHROUGH is available via compiler_specific.h, remove
FX_FALLTHROUGH.
Change-Id: I8b9631a4f007673e10e0c26951dfd61e9dcada30
Reviewed-on: https://pdfium-review.googlesource.com/32639
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Remove some unused args along the way.
Change-Id: I234a674d4d6cc79b33087bc850f5df36bae25870
Reviewed-on: https://pdfium-review.googlesource.com/32596
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I959fe5dc30fcfe2176c7e5a64b07d082313a22b4
Reviewed-on: https://pdfium-review.googlesource.com/32595
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up the CPDF_ContentParser code. The m_bIsDone flag has
been removed and a kComplete stage added. Each of the processing methods
returns the next stage instead of setting the internal flag
automatically. The infinite loop is removed for simpler straight line
code.
Change-Id: Id817a5fa054e28c331c68c63ec2c12b369cb0233
Reviewed-on: https://pdfium-review.googlesource.com/32611
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Provides more lifetime/bounds checking "for free".
Change-Id: Ifaf7a95c0f6f288777cd6ef35996e01b3dc4bc63
Reviewed-on: https://pdfium-review.googlesource.com/32594
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL separates the parts of CPDF_ContentParser::Continue into three
distinct methods. It clarifes when and what is returned from Continue.
Change-Id: Id7a9bf1aa16f366f567cce74006c27c452cb5dcc
Reviewed-on: https://pdfium-review.googlesource.com/32531
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL folds the StartParse() method of CPDF_Form into the
ParserContent method. The no arguments ParseContent is removed and
ParseContentWithParams renamed to ParseContent. The callsites are
updated to pass the nullptr's.
Bug: chromium:813349
Change-Id: I304b77aef1de1b9aa20e4a3044db5023f5701584
Reviewed-on: https://pdfium-review.googlesource.com/32511
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 466bd4f4e0cb2bc2a7b3626948609268c52c4690.
Reason for revert: On closer inspection, it seems the test is not
flaky, and the root cause of the failure is an SEH exception,
which is the true source of flakiness. Other tests are also affected.
Original change's description:
> Revert "Filter out "Type" and "DecodeParms" from trailer keys."
>
> This reverts commit 5f7c5be8b7072d46e8d8088a1ec14370ecfad44c.
>
> Reason for revert: New test is flaky, ID is not stable.
>
> Original change's description:
> > Filter out "Type" and "DecodeParms" from trailer keys.
> >
> > Bug: pdfium:873
> > Change-Id: I12ae5b8776f5a73c4be81bed53ada05c94d46882
> > Reviewed-on: https://pdfium-review.googlesource.com/32190
> > Reviewed-by: dsinclair <dsinclair@chromium.org>
> > Commit-Queue: dsinclair <dsinclair@chromium.org>
>
> TBR=dsinclair@chromium.org,hnakashima@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: pdfium:873
> Change-Id: I642771e12c61181c7b81681dae7b2f5549c14b18
> Reviewed-on: https://pdfium-review.googlesource.com/32430
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=dsinclair@chromium.org,hnakashima@chromium.org
Change-Id: I2552729610c9f8adf02c70a2a43e2383ceda19b5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:873
Reviewed-on: https://pdfium-review.googlesource.com/32397
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This reverts commit 5f7c5be8b7072d46e8d8088a1ec14370ecfad44c.
Reason for revert: New test is flaky, ID is not stable.
Original change's description:
> Filter out "Type" and "DecodeParms" from trailer keys.
>
> Bug: pdfium:873
> Change-Id: I12ae5b8776f5a73c4be81bed53ada05c94d46882
> Reviewed-on: https://pdfium-review.googlesource.com/32190
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: dsinclair <dsinclair@chromium.org>
TBR=dsinclair@chromium.org,hnakashima@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: pdfium:873
Change-Id: I642771e12c61181c7b81681dae7b2f5549c14b18
Reviewed-on: https://pdfium-review.googlesource.com/32430
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Use one std::vector<>, too. As a result, make GetDecodeAndMaskArray()
update that member directly rather than forcing callers to assign to
it each time.
Change-Id: I51a039b9e8cce7ff885edf395622eaf6a5c4816a
Reviewed-on: https://pdfium-review.googlesource.com/32313
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Encapsulates transparency status instead of having it be a raw int.
Change-Id: I8b10dafa97da112795cf84c46cf416a0294551d5
Reviewed-on: https://pdfium-review.googlesource.com/32194
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The order of the elements in the header is correct, but we
were clearing it early in the destructor itself.
Bug: 840695
Change-Id: I1585722fed8dc672ffd5e1dc9a1eea1c7c80f310
Reviewed-on: https://pdfium-review.googlesource.com/32311
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Instead of having const methods that return non-const pointers.
BUG=pdfium:234
Change-Id: I61495543f67229500dfcf2248e93468e9a9b23cf
Reviewed-on: https://pdfium-review.googlesource.com/32183
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Instead of having const methods that return non-const pointers.
BUG=pdfium:234
Change-Id: I598e9b4f267f702e2e71001cfe3aa3c9e9d8c12f
Reviewed-on: https://pdfium-review.googlesource.com/32182
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
The owned copy needs to be modified, so it should be non-const. Whereas
the unowned copy can be const.
Add a GetClonedDict() method for accessing the modifiable dictionary.
Change-Id: Ia7f6bcc5f917864cd1bbc7b5000a86f6e433ae9a
Reviewed-on: https://pdfium-review.googlesource.com/32181
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
They are mostly CPDF_Object* and derived classes, but others that should
be are marked const as well.
Change-Id: Ib3344d7d8db90940df8edc97c0dd6c59da080541
Reviewed-on: https://pdfium-review.googlesource.com/32180
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=pdfium:1049
Change-Id: I3a589fe51f2e584dc130ba31faa144d4494a1b08
Reviewed-on: https://pdfium-review.googlesource.com/32179
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Fix some nits in the code in the process.
Change-Id: I660b3bf547823a11bc291ed2dd1ec19a76b24b5b
Reviewed-on: https://pdfium-review.googlesource.com/32178
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:873
Change-Id: I12ae5b8776f5a73c4be81bed53ada05c94d46882
Reviewed-on: https://pdfium-review.googlesource.com/32190
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Tested by running safetynet_compare.py on this patch vs master. The
results were 0 regressions and 0 improvements. The two remaining usages
cannot be replaced because they would cause a regression.
Bug: pdfium:177
Change-Id: I43eddf4ffaac2eb063f2004d6606bc3cd6e627ac
Reviewed-on: https://pdfium-review.googlesource.com/32159
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
No code actually checks to see if it is set.
Change-Id: I37631713d568f116df1c0495ffd7d7d64ddce69a
Reviewed-on: https://pdfium-review.googlesource.com/32186
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Add constants/transparency.h. The header lists constants from chapter 7
of the PDF spec.
BUG=pdfium:1049
Change-Id: I66bd6fceb24807eec9c308e2e47cec3f2f836ffb
Reviewed-on: https://pdfium-review.googlesource.com/32177
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Use it in more places there.
Change-Id: I477670a5946ec9033ad5f2bef0fbcddb52682066
Reviewed-on: https://pdfium-review.googlesource.com/31271
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Avoids a conflict should we wish to have the document actually
track pages, with a GetPage() that returns CPDF_Page.
Do the same thing to CPDF_DataAvail along the way.
Add some missing consts as well.
Change-Id: I2cb2213cc4c0649662fceab80407ee4a3f4cf30e
Reviewed-on: https://pdfium-review.googlesource.com/32158
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id9288d504f063759f69632ab59b0a21569ff76d8
Reviewed-on: https://pdfium-review.googlesource.com/32113
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id31b9f6ac33971c47cdb378ff7f9ca7d33f899b9
Reviewed-on: https://pdfium-review.googlesource.com/32112
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also initialize members in the header.
Change-Id: Id814c4c5042c9d4989fa92b78f68c17f4949f09d
Reviewed-on: https://pdfium-review.googlesource.com/32111
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I3fe99ecb17d37f893ce5d0d59219c82ee31fe7ea
Reviewed-on: https://pdfium-review.googlesource.com/32110
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Avoids scrolling past this noise when looking at document code.
No functional changes.
Change-Id: I4684a8cf4d8894c699cd1c980bc5fc41b2179ad1
Reviewed-on: https://pdfium-review.googlesource.com/32156
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I9d87cefc18a3a468e1bec797bc7711194f6444c7
Reviewed-on: https://pdfium-review.googlesource.com/32155
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Also move static private members into the .cpp file.
Change-Id: Idbbdc7c78ac4199968888466caa20c58a5653dfd
Reviewed-on: https://pdfium-review.googlesource.com/32151
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This existing code has the potential for an integer overflow in it.
When overflow occurs in this function scaling may partially succeed.
This is due to how out of range values are being clamped, which
implicitly swallows the overflow.
This CL changes the calculation to be performed in a 64-bit space and
then attempts to down cast it back to 32-bit space at the end. Because
there are multiple steps it is possible for an intermediate value to
cause an overflow in 32 bit space, but the final value to be valid. If
the downcast is not possible then the stretch operation is failed.
An existing test case has been updated, since it encoded an incorrect
result.
BUG=chromium:839245
Change-Id: I637cc1e2d6c6c2d5394599104f76352c20ead021
Reviewed-on: https://pdfium-review.googlesource.com/32056
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
In turn, add CPDF_Document::Extension::GetPDFDoc() so that we can
use the abstract return type in more places.
Mark an internal-only cpdfxfa_context method as private while we're
at it.
Change-Id: I08e64f4b9438bf2f731c3a37cf2a41152bbbd8fa
Reviewed-on: https://pdfium-review.googlesource.com/31916
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Small oversight. Gets type safety.
Change-Id: I669c2c990fdf9013f4bc4835738132ed76e734b8
Reviewed-on: https://pdfium-review.googlesource.com/31991
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Another virtual API at the CPDF layer, to avoid a compile time
ifdef XFA.
Change-Id: Ia95c4d3b3d3b773aaf45c49ebcadff6b16ca18c6
Reviewed-on: https://pdfium-review.googlesource.com/31910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Replaces one compile-time #ifdef XFA with a dynamic check and
a call through a virtual API that prevents the CPDF code from
knowing anything about the XFA code.
Change-Id: If0ff9b6918b908b3eac824fe1d525c6d4f7316e7
Reviewed-on: https://pdfium-review.googlesource.com/31890
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This is an obstacle to introducing dummy CPDF_Pages to underly all
CPDFXFA_Pages, since we would then have a parserless CPDF_Page, whose
parse could never succeed or fail. The m_ParseState would never change,
and if the caller dutifully recalls us until that changes, we hang.
Small separate CL since it might impact non-XFA cases unexpectedly.
Change-Id: I002064e5d4caa44935f50bde0f3b00e3b8cb0bfe
Reviewed-on: https://pdfium-review.googlesource.com/31850
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Greatly minimize the impact between going back and forth from
XFA being on/off, so that XFA case is just an extension beyond
the non-XFA data structures we've shipped for years, instead of
being a complete replacement of them.
Change-Id: I6c98206e0ec99ea443547a4931eba912b1764d54
Reviewed-on: https://pdfium-review.googlesource.com/31690
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Similar tp CPDF_Document::Extension, this is a base type for fpdfsdk/
to use to improve layering.
While we're at it, make pages point to documents to prove they don't
outlive them.
Another small step towards not passing XFA objects across FPDF.
Change-Id: Idcee9da3a18c06331fa56f3d6c188e4ce27d34f2
Reviewed-on: https://pdfium-review.googlesource.com/31631
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Should FPDFDocumentFromCPDFDocument() be called several times under
XFA, we may WrapUnique() the document several times. So cache a pointer
back from CPDF_Document to CPDFXFA_Context to avoid this.
Because of layering, introduce a placeholder type CPDF_Document::Extension.
This is actually the first step in some larger XFA ownership cleanup, but
makes a nice standalone CL around the one particular issue.
Change-Id: I4be326ddb1a5fae7339e6ed6745dd551b1374b53
Reviewed-on: https://pdfium-review.googlesource.com/31570
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This time, correctly multiply |nTotalSampleBits| before checking it.
Change-Id: I68befeedb54626314f7bb00a35e567d2cbf1cc10
Reviewed-on: https://pdfium-review.googlesource.com/31152
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I9dd6a36770f77f3df6c4395572785d37402eadc2
Reviewed-on: https://pdfium-review.googlesource.com/31350
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ic62f1def8e043494c9fa6c08a937d7d872513567
Reviewed-on: https://pdfium-review.googlesource.com/31314
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|