Age | Commit message (Collapse) | Author |
|
When parsing UTF16-LE, the default trailing "\0" from a single-byte
character literal isn't suffucient.
TBR=dsinclair@chromium.org
Bug: 835184
Change-Id: Ie7db53262adbec0ebccb5d0b22752b8c9f5e6229
Reviewed-on: https://pdfium-review.googlesource.com/31191
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
(cherry picked from commit 9f71afb882a9d1294f8a4392b8553e2c285f51c7)
Reviewed-on: https://pdfium-review.googlesource.com/31630
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=chromium:833721
TBR=tsepez@chromium.org
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>
(cherry picked from commit e06880f8eb984a48921f0560bd7ab4e055da432d)
Reviewed-on: https://pdfium-review.googlesource.com/31131
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>
(cherry picked from commit 0d32b8fda53e02c1036d39f7290d4f59f2b58ca4)
Reviewed-on: https://pdfium-review.googlesource.com/30951
|
|
This reverts commit 80a6cbe0a427e155de8555bc867af745d10f9777.
Reason for revert: too many abrts in beta branch.
TBR: dsinclair@chromium.org
Bug: 832557, 832978, 832992, 833062, 833097
Change-Id: I7d511dbb224ddc644be96ea2f3770ad6f73debf5
Reviewed-on: https://pdfium-review.googlesource.com/30792
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
(cherry picked from commit 3d523e3cf89440e2ffc6571b1c687ad5e3f0318f)
Reviewed-on: https://pdfium-review.googlesource.com/30950
|
|
All the callers pass in a valid colorspace. SetColorSpace() is the only
caller to CPDF_ColorSpace::GetDefaultColor(). Also adjust that method to
make it harder to use incorrectly.
Change-Id: I5cf7b6d2abef630e1b9443043b13d1c2b5bed18a
Reviewed-on: https://pdfium-review.googlesource.com/30351
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Get bounds checking "for free".
Change-Id: I7b14cacbc7130ced7b5cb1869b82c96ccff8e642
Reviewed-on: https://pdfium-review.googlesource.com/30451
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
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>
|
|
Follow up to request in
https://pdfium-review.googlesource.com/c/pdfium/+/30190
BUG=chromium:802242
Change-Id: I8fddd78d235a195c9782c3f6ced428de965e85eb
Reviewed-on: https://pdfium-review.googlesource.com/30250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
In the case that the low level LZW decoder has indicated insufficient
destination size, if another call to decode returns this status after
adjusting the destination size, consider it an error. Subsequent
iterations will not return a larger destination size, since the
expected row size doesn't change, so the code will just loop
infinitely, trying to decode a too large row.
BUG=pdfium:1059
Change-Id: I14c8cee721fa77d8aab5e99deff9406490f01468
Reviewed-on: https://pdfium-review.googlesource.com/30452
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Make a copy of the input data when clamping it in CPDF_Function::Call().
Change-Id: I1d2b3d080977f0f9a4c3ccaf111780867668991a
Reviewed-on: https://pdfium-review.googlesource.com/30350
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Instead of taking two doubles. The doubles get casted to floats anyway.
Change-Id: Ie16dc60fa5d6412026a5fda08c8c64d4fa2d56c4
Reviewed-on: https://pdfium-review.googlesource.com/30410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Do the same for FPDF_PageToDevice(). Clean up the internal
implementation as well.
Change-Id: Ia207bfa779d144cb9f0310e768750ab10e603b8f
Reviewed-on: https://pdfium-review.googlesource.com/17370
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Just like CPDFXFA_Page. Also mark the methods const.
Change-Id: I6717b4b61a29663780f45bf872f76fe8e671df75
Reviewed-on: https://pdfium-review.googlesource.com/30132
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Instead of many int in-parameters.
Change-Id: I58b493ac0155f6b45f52963c0f61159633d88e28
Reviewed-on: https://pdfium-review.googlesource.com/30056
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I079bc3bf1242fd28fdd51930d9deb6efa34d7509
Reviewed-on: https://pdfium-review.googlesource.com/30055
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I6643aaf66bf3e9d53d5afab5c99a5cb7deab3661
Reviewed-on: https://pdfium-review.googlesource.com/30054
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
- Pass matrices by const-ref instead of by pointers.
- Mark one SetClip_Rect() variant as XFA-only.
- Pass std::vector into DrawFillArea().
- Simplify the only DrawFillArea() caller.
Change-Id: I8f7497e4d46345d50ac4cc8f3e7eef135644e7a7
Reviewed-on: https://pdfium-review.googlesource.com/30131
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
These were kicked loose when we converted to span<>, and there isn't
any reason to believe that the remaining string is long enough to
complete a multibyte sequence.
Bug: 831100
Change-Id: Iae4363f72b4d7ff088a73994d0fe5dab4077ee9e
Reviewed-on: https://pdfium-review.googlesource.com/30291
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the import data behaviour as it was never called and
cleans up the m_bDocumentParser flag as it will always be used in the
true case.
Change-Id: If90a0a55cc76f406e9987aa71580e90edeaa01ba
Reviewed-on: https://pdfium-review.googlesource.com/30292
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes the return type of CFX_XMLParser::GetStatus to correctly
return bool instead of int32_t.
Change-Id: Ifa0d24b8aad55c4cf63ddf7cfc8eee48bf8431bf
Reviewed-on: https://pdfium-review.googlesource.com/30290
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CFX_XMLDoc and calls the CFX_XMLParser directly from
CXFA_DocumentParser.
Change-Id: I4d715cca90cd15b5e1d79827e0bb2781e873e371
Reviewed-on: https://pdfium-review.googlesource.com/30251
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CXFA_FFDoc to no longer use the CXFA_FFApp to create the
document, it does it directly. The stream data is not stored in the
FFDoc anymore as it is only used once.
Change-Id: I8247d2fb0324e554250ff0a03c67f067ef46e437
Reviewed-on: https://pdfium-review.googlesource.com/30270
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CXFA_SimpleParser is handling the XFA document parsing. This CL
renames the class to make it clearer that this is the XFA document
parser.
Change-Id: Ia290df2671fba9efa221ae997156ee4846749b02
Reviewed-on: https://pdfium-review.googlesource.com/30231
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CXFA_DocumentParser is a thin wrapper around CXFA_SimpleParser. This
CL folds CXFA_DocumentParser into a ParseDoc method of CXFA_FFDoc.
Change-Id: I7e7073899436f0435c4ebfd548241ae842a2a276
Reviewed-on: https://pdfium-review.googlesource.com/30213
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes the document parser to store the parsed XML tree. That
way we no longer need to store the pointer to the CXFA_SimpleParser in
the CXFA_DocumentParser.
Change-Id: I9272150e73613411cb1bb59c3cf77c7af6cc799d
Reviewed-on: https://pdfium-review.googlesource.com/30211
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the
CFX_XMLDoc. This way, we don't have to keep the doc around and can store
the pointer to the tree in the CXFA_SimpleParser.
Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c
Reviewed-on: https://pdfium-review.googlesource.com/30210
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CFX_XMLParser was a wrapper around the CFX_XMLSyntaxParser. This CL
merges the SyntaxParser into protected/private methods if the XMLParser.
Change-Id: If1519b5de55866ed14359dffd64dc12c36ee0244
Reviewed-on: https://pdfium-review.googlesource.com/30171
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up minor nits in the CFX_XMLParser code.
Change-Id: Ie19d12d3dcce16c9ce6088160ecdec3d9855c11f
Reviewed-on: https://pdfium-review.googlesource.com/30170
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the code for verifying and creating checksums associated
with form elements in XFA documents. This was the only code requiring
the SAXReader which has also been removed.
According to the XFA spec and application can decide which parts of the
signatures are supported. This feature is being removed until we
determine if/when it is needed.
Bug: pdfium:1063
Change-Id: Iec2261282340f8fc72a1225d2e0d3e6ddf05edcb
Reviewed-on: https://pdfium-review.googlesource.com/30150
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
It is set in a couple of places, but the value is never used
for any purpose.
Change-Id: I6fc0839bc14b21ee8217fcb3eadf6c252ad67aa7
Reviewed-on: https://pdfium-review.googlesource.com/30330
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Also fixes any problems with cycles between colorspaces.
Past fixes have solved problems with CPDF_DocPageData::GetColorSpace()
calling itself and CPDF_DocPageData::GetColorSpace() calling
CPDF_ColorSpace::Load() and vice versa. They have not solved
CPDF_ColorSpace::Load() calling itself.
This CL repurposes the |pVisited| set to ensure CPDF_ColorSpace::Load()
does not try to load a colorspace as a dependency of itself and
creates |pVisitedLocal| to ensure CPDF_DocPageData::GetColorSpace()
does not create a similar circular dependency not involving
CPDF_ColorSpace::Load().
Bug: chromium:828206
Change-Id: Ib2d0ec494be169135607f3651e0f70627b26ebd7
Reviewed-on: https://pdfium-review.googlesource.com/29810
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Remove stray const in operator[] that was introduced when downgrading
from C++14 to C++11 syntax.
Add missing Get() in first() that was introduced when converting
to UnownedPtr.
Prevent ASAN from flagging spans where the UnownedPtr points to byte
N+1 of a N byte object, and the span is empty. This is legal in C for
ordinary pointers so long as the pointer isn't de-referenced, but is
not allowed per the rules for UnownedPtr.
Change-Id: Ic143c5ef4e37c1cf86f0a3e5408be6e2076a85e2
Reviewed-on: https://pdfium-review.googlesource.com/30212
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Greatly simplify the code which was neither changing allocations nor
doing any actual work. Eventually GetBuffer() will return a span, and
this makes fewer places to change.
Comment AsFPDFWideString() as a place where we may want a redundant
copy, and make available outside the .cpp file.
Fix one "const" along the way.
Change-Id: I187758b69a0ba3501b3622f6c06280793cd5d464
Reviewed-on: https://pdfium-review.googlesource.com/30011
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
As currently written, the calculation of m_end will underflow
when passed a {nullptr, 0} pair as input, and m_end becomes
essentially unbounded.
Change-Id: Id3249b201c446555d9aa4fa04e6a3c94a357cd99
Reviewed-on: https://pdfium-review.googlesource.com/30230
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
After advancing past whitespace, the buffer may become empty. We were
checking too early.
Bug: 831498
Test: covered by fuzzers
Change-Id: I6796b4723a05c2bcafe495dc7bc648213aa9cc22
Reviewed-on: https://pdfium-review.googlesource.com/30191
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
In the test case from the bug, the majority of the time is being spent
resizing Widestring internal buffers, since += is being called in a
tight loop. Since the size of the input being mutated and stored is
known, this CL reserves the space before hand to lower thrashing. This
substantially improves runtime of this test case locally.
BUG=chromium:802242
Change-Id: I5176dabc94634b4d6bc3e9425fe6469a5bf35a41
Reviewed-on: https://pdfium-review.googlesource.com/30190
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:830706
Change-Id: I72ea6373d898953c10e523399655f1f630941b09
Reviewed-on: https://pdfium-review.googlesource.com/30110
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
CPDF_StitchFuncs that reference each other create a Load() loop.
Maintaining a set of the visited CPDF_Objects during a Load()
call tree prevents that.
Bug: chromium:830221
Change-Id: I6f494da16c6d79f05870ff85cff38ff8fe69ecfe
Reviewed-on: https://pdfium-review.googlesource.com/30050
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Make sure they match their win32 equivalent data types.
Change-Id: I395054ce5c5ae110c78dbae30dd985fc498045fb
Reviewed-on: https://pdfium-review.googlesource.com/30070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:813705
Change-Id: I57265aad11d8f717f6ce33cc09241f4bef6381db
Reviewed-on: https://pdfium-review.googlesource.com/29710
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Roll DEPS for Clang to d7c36b0a.
https://chromium.googlesource.com/chromium/src/tools/clang/+log/7d56ff90..d7c36b0a
Roll DEPS for build to 57e31076
https://chromium.googlesource.com/chromium/src/build/+log/74c3e063..57e31076
TBR=dsinclair@chromium.org,thestig@chromium.org
Change-Id: I490ee17ad5d641917bb91349e25c46e2762481be
Reviewed-on: https://pdfium-review.googlesource.com/30090
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
When building a complete static lib using pdf_is_complete_lib, assert
that is_component_build=false, so that 'component' targets will be
statically linked into the final product, instead of being
dynamically linked in.
We cannot have a rule like if pdf_is_complete_lib then
is_component_build=false, because the is_component_build arg is
defined in a file we import and overwriting the value later doesn't
do what one expects, since the value has already been used in the
imported file set things like env vars and build flags. Thus we
assert the value and have a message about needing to set
is_component_build=false.
BUG=pdfium:1062
Change-Id: I83c430ca374e70c01f18e4b15a1eeb68aafa4444
Reviewed-on: https://pdfium-review.googlesource.com/30030
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
It is rarely used and FX_RECT is the more common integer rect type.
Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61
Reviewed-on: https://pdfium-review.googlesource.com/30053
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It currently takes const FX_RECT*, but the pointer is never nullptr.
Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b
Reviewed-on: https://pdfium-review.googlesource.com/30052
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
They currently take const FX_RECT*, but the pointer is never nullptr.
Also add a comment to explain why FX_RECT is the way it is. It has the
same layout as a win32 RECT.
Change-Id: Icf0e4c3eb25fe03317590a736578e053b9dccf7a
Reviewed-on: https://pdfium-review.googlesource.com/30051
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This makes XFA widgets lose focus when a click is performed outside
their area.
Bug: chromium:820256
Change-Id: I7b70fafdc625089f3340a3494bfd51e5c8d0446d
Reviewed-on: https://pdfium-review.googlesource.com/29860
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The first step, AcceptsFocusOnButtonDown(), returns whether the
widget wants focus on a mouse click.
The second step, On{L|R}ButtonDown(), handles the click after focus
has been assigned.
Bug: chromium:820256
Change-Id: I9da1f1a930f198fc17b24acb7f1e3e6ef7f12ae4
Reviewed-on: https://pdfium-review.googlesource.com/29951
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
The StartParse and DoParse methods have been merged into a single Parse
method.
Change-Id: I1310bda90b853c11af8b8d1794de6b5c19e931cf
Reviewed-on: https://pdfium-review.googlesource.com/30010
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I92c7ba605bf95a9023ad046b8dddebe0a0592802
Reviewed-on: https://pdfium-review.googlesource.com/29992
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1232e6c61cbe696d90d87f461ebed0a7aea40893
Reviewed-on: https://pdfium-review.googlesource.com/29973
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|