Age | Commit message (Collapse) | Author |
|
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>
|
|
Applies std::remove_ptr to the public API types so that we can
deduce a correct unique ptr type no matter how that API might
change away from void* usage.
Creates shorter names for std::unique_ptr<std::remove_pointer<>, ...>
Change-Id: I04a0ff43cb7d5a4d3867939a53a54c9cef00db86
Reviewed-on: https://pdfium-review.googlesource.com/31292
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:41
Change-Id: I98070a5a6c88a0769f2b571eae4fe62092f7dfcd
Reviewed-on: https://pdfium-review.googlesource.com/31232
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It is required to be an array of positive integers. The existing
implementation seems to accommodate non-compliant PDFs where the Size
entry is an integer.
Change-Id: I58faa3f84ca627f189c67bab5884d4b1f9b105ca
Reviewed-on: https://pdfium-review.googlesource.com/31151
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Allows run-time selection of whether to permit JS inside PDF. Previously,
this was a link-time decision only. This requires a little more caution
before we decide that we have the CJS_Runtime, and not the CJS_RuntimeStub
in a few casts.
Adds a kDisableJavaScript option to the form fill embeddertests.
Adds a --disable-javascript flag to the pdfium_test executable.
Also adds a --disable-xfa flag while we're at it.
Change-Id: I8d8ac95f6474459cadba9a60572fbb342e984646
Reviewed-on: https://pdfium-review.googlesource.com/31090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I54aae3c65ded779f1421b8f971a187979e5a204b
Reviewed-on: https://pdfium-review.googlesource.com/31150
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Currently, one gets data from CPDF_PatternCS via its parent class's
GetRGB(const float* pBuf) method. To squeeze through this interface, the
caller has to pass in a float*, and CPDF_PatternCS::GetRGB() has to cast
it to PatternValue*.
Instead of doing casting, add a specialized GetPatternRGB() method to
CPDF_PatternCS. In its parent class, CPDF_ColorSpace, add AsPatternCS()
so callers can get a CPDF_PatternCS* from a CPDF_ColorSpace*. Change
existing callers to use these new methods.
Change-Id: Id476c9ece7ce8d3499a718acc682bc25036a5407
Reviewed-on: https://pdfium-review.googlesource.com/31030
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This reverts commit 54e6da1ee793f436341dfcdc4e0c26b0658d1928.
Reason for revert: Checks not ordered correctly.
Original change's description:
> Do validation earlier in CPDF_SampledFunc::v_Init().
>
> Change-Id: Ib44b39aea419230f73583caf69313a2f92557397
> Reviewed-on: https://pdfium-review.googlesource.com/30932
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
TBR=thestig@chromium.org,hnakashima@chromium.org
Change-Id: I133ca5add12c173dd05ef995b5834c3058d814cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://pdfium-review.googlesource.com/31050
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I06eab59d7944309d6fe99b97956e8ffb11d64088
Reviewed-on: https://pdfium-review.googlesource.com/30991
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Iaa3988cea5cdc6ce723c59ad051800925216d81b
Reviewed-on: https://pdfium-review.googlesource.com/30990
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I8eeaf62947960d8774cb129be145fae157feb70e
Reviewed-on: https://pdfium-review.googlesource.com/30970
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Also do some cleanup and use FX_SAFE_UINT32.
Change-Id: I8e9fc49fb768cfc4b13b164c1dcf51b8ca99ec0b
Reviewed-on: https://pdfium-review.googlesource.com/30934
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: Ib44b39aea419230f73583caf69313a2f92557397
Reviewed-on: https://pdfium-review.googlesource.com/30932
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
They are required for type 0 and type 4 functions. The number of outputs
should not be 0.
Change-Id: I4cb1fa14a32ef0a1c92230d83461c697f389106f
Reviewed-on: https://pdfium-review.googlesource.com/30931
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:833721
Change-Id: I3ca878760c12144ef27a71dcbbfd7c18d12a5f3b
Reviewed-on: https://pdfium-review.googlesource.com/30992
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Get bounds checking "for free".
Change-Id: Ic60d63836f6c223e2ee1262649d47da54bb30ecc
Reviewed-on: https://pdfium-review.googlesource.com/30876
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 3d523e3cf89440e2ffc6571b1c687ad5e3f0318f.
Fixes bounding errors now caught by tests.
Change-Id: I4d0f1791bdcc45a10615a62abf7a4d20e7e538f2
Reviewed-on: https://pdfium-review.googlesource.com/30799
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Add constants/stream_dict_common.h. The header lists all the constants
in the table in the same order. Constants that are not used at all are
commented out.
BUG=pdfium:1049
Change-Id: I6539090e0ad56319ea628883e388aeacef044e52
Reviewed-on: https://pdfium-review.googlesource.com/29090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This reverts commit 0d32b8fda53e02c1036d39f7290d4f59f2b58ca4.
Restore behaviour on trunk.
TBR: dsinclair@chromium.org
Change-Id: Ia867f09ae9d2885595c4d9b300a058431dfd84f2
Reviewed-on: https://pdfium-review.googlesource.com/30811
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
- Switch away from FX_Alloc2D() when it is safe to do so.
- Use FX_SAFE_SIZE_T to avoid a potential underflow with FX_Realloc().
- Mark the v_Call() input as const.
- Check Call() and v_Call() return results.
Change-Id: I6ec3122b23e0f137f88aa8d85a9675154a1b1706
Reviewed-on: https://pdfium-review.googlesource.com/30802
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This makes it easier to control modifications to the page object
list.
Bug: pdfium:1051
Change-Id: Ia85c597fa6d39e89041b990b4b6c91e327ef811d
Reviewed-on: https://pdfium-review.googlesource.com/30803
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This reverts commit 154e18f9a862975abecebe77b8f5fb418418d14c.
Reason for revert: Generate CL to merge to beta branch
Original change's description:
> Return pdfium::span<wchar_t> from WideString::GetBuffer().
>
> Adds bounds checking "for free", but beware of span outliving
> a ReleaseBuffer() call. Scoping as such avoids the possibility
> of using an invalid span (and it is flagged as a lifetime issue).
>
> Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c
> Reviewed-on: https://pdfium-review.googlesource.com/30310
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
TBR=tsepez@chromium.org,dsinclair@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ie1ec9434215584a024538ca8edeb59dea555af48
Reviewed-on: https://pdfium-review.googlesource.com/30830
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
FX_Realloc() never fails. So either remove the check or switch to
FX_TryRealloc().
Change-Id: I11fd02508add50db900a7502835018c2b61bcd09
Reviewed-on: https://pdfium-review.googlesource.com/30712
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Also use more constants.
Change-Id: I02cb74d5ef5a44b1772d826be63ceb64b167c0db
Reviewed-on: https://pdfium-review.googlesource.com/21913
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Because the implementations are in fpdf_parser_utility.cpp
Add unit test for both.
Change-Id: Ibae90ecbe625a035c450614ddbe7f5969f9f92aa
Reviewed-on: https://pdfium-review.googlesource.com/30793
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|