Age | Commit message (Collapse) | Author |
|
This reverts commit a5d7ad3aa8feb08a14b5cca173d673054c1ade23.
Reason for revert: Speculative revert to get back before flake.
Original change's description:
> Introduce FX_Number class as a replacement for FX_atonum().
>
> The issue with FX_atonum() is that it doesn't return any information
> about whether it range-checked its integer values as a signed or
> unsigned type, even though it knows this as part of its processing.
>
> Rather than adding another out parameter to that function, create
> a class to hold all this information together.
>
> This is the first place things went astray while diagnosing
> bug 882959, in that a large positive value was cast to float as a
> negative value. Unfortunately, this doesn't affect the related bug,
> but is a step in the right direction.
>
> Change-Id: I0977ec8fccf85e2632a962507bdd30a1cbe6d33c
> Reviewed-on: https://pdfium-review.googlesource.com/42353
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
TBR=thestig@chromium.org,tsepez@chromium.org
Change-Id: Ia56270c3daa80408fc2b23eb4384a77f03f45b82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://pdfium-review.googlesource.com/42392
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 882ed81dec7afc5bc106f965af34f1e59407fd95.
Reason for revert: Rule out that this be making embeddertest flakey.
Seems improbable, but maybe the const is allowing the compiler to use stale data in a non-logically const operation ???
Original change's description:
> Make things more const-y
>
> Follow up to https://pdfium-review.googlesource.com/c/pdfium/+/42350
> to use const more in the changed code.
>
> BUG=chromium:881678
>
> Change-Id: I7a88862952c9ba25ffa89c2827e1de322f3b5c33
> Reviewed-on: https://pdfium-review.googlesource.com/42370
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
TBR=thestig@chromium.org,hnakashima@chromium.org,rharrison@chromium.org
Change-Id: Ifee656f151d3e6dab6de33c3b96b37b9809004c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:881678
Reviewed-on: https://pdfium-review.googlesource.com/42372
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I2b1e5cc7a9576b5bb3bf3888225d1f6e54e0c95b
Reviewed-on: https://pdfium-review.googlesource.com/42051
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Follow up to https://pdfium-review.googlesource.com/c/pdfium/+/42350
to use const more in the changed code.
BUG=chromium:881678
Change-Id: I7a88862952c9ba25ffa89c2827e1de322f3b5c33
Reviewed-on: https://pdfium-review.googlesource.com/42370
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
The issue with FX_atonum() is that it doesn't return any information
about whether it range-checked its integer values as a signed or
unsigned type, even though it knows this as part of its processing.
Rather than adding another out parameter to that function, create
a class to hold all this information together.
This is the first place things went astray while diagnosing
bug 882959, in that a large positive value was cast to float as a
negative value. Unfortunately, this doesn't affect the related bug,
but is a step in the right direction.
Change-Id: I0977ec8fccf85e2632a962507bdd30a1cbe6d33c
Reviewed-on: https://pdfium-review.googlesource.com/42353
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
In this parser, a vector of CodeRange values are built up during
operations that need to be sync'd with the CPDF_CMap that is being
initialized. In the existing implementation, the vector being built as
a member var for the parser, and copying the values over to the cmap
whenever there is a change. When profiling, this copy is where the code
spends most of its time.
The code has been rewritten to have the parser reference/modify the
instance of the vector in the cmap instead of having its own copy. This
removes all of the copies and significantly speeds things up.
BUG=chromium:881678
Change-Id: Ib8e75962507ca3d3b1ed066fd1faa4fbb7141122
Reviewed-on: https://pdfium-review.googlesource.com/42350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:835667
Change-Id: I3b9fd04d26f1baa30d48f938616b187410134b5f
Reviewed-on: https://pdfium-review.googlesource.com/42311
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
There is missing build coverage, apparently.
Change-Id: Ibaf3a8d3f478eca6ab683bdcf0d7a91eeddafde3
Reviewed-on: https://pdfium-review.googlesource.com/42290
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
When parsing happens in several steps (in pages with > 100 page
objects), the position is reset to 0 and the start pointer is
advanced. This breaks the calculation of which stream an object
belongs to.
Passing in the base pointer separately from the start offset allows
the correct position to be calculated and the correct stream to be
identified.
Change-Id: Ic0d5f59f437609158aa97b3c8a18dbd48cd3b0d4
Reviewed-on: https://pdfium-review.googlesource.com/42270
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
An assignment statement accidentally got removed in
https://pdfium-review.googlesource.com/c/pdfium/+/31538.
BUG=chromium:880920
Change-Id: Iaff20bd2484cd8bf6dc6a13cbf444cefbd605b25
Reviewed-on: https://pdfium-review.googlesource.com/42250
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
The copy will never be read.
Change-Id: I129859ed7569e054e66f00314f8ecf20e2c67715
Reviewed-on: https://pdfium-review.googlesource.com/41854
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Idb14846e87a8287dd911b0a2f7a32146e86c2af7
Reviewed-on: https://pdfium-review.googlesource.com/41853
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1dc99831a564e88035c317455411f1eba9aa41c4
Reviewed-on: https://pdfium-review.googlesource.com/41852
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Do the same for A85Decode().
Change-Id: Ic6a0e5e8a63defa104e35e97eb9ce4223aac23a7
Reviewed-on: https://pdfium-review.googlesource.com/41851
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The whole point of this wrapper method is to disallow partial
reads, so name it accordingly.
No functional change.
Change-Id: Ia2e7ee756192615f399369d5b077b836438befb2
Reviewed-on: https://pdfium-review.googlesource.com/42150
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bug: 847283
Change-Id: I7951103a5a425407b5375460a5556e8765430740
Reviewed-on: https://pdfium-review.googlesource.com/42090
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Small consolidation before trying to fix a memory issue.
Unfortunately, this involves converting a switch -> ifs, since we
no longer dispatch exactly the same.
Change-Id: I7ef61db98cdfbbc983adf21e7b3fe4ef1d2ce869
Reviewed-on: https://pdfium-review.googlesource.com/41830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Use the preferred idiom of creating a subspan, which makes the
proper checks prior to the copy.
Change-Id: Ia7f25b5760dea5707df66cf421195b23a1ce0ad0
Reviewed-on: https://pdfium-review.googlesource.com/41911
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Given a span of size N, memcpy(dest, &span[N], 0) ought to be a no-op,
but since we compute span[N] before checking for zero length, we hit
an assert. The correct idiom should be to create a sub-span, which
allows specifying N, but only when the size is 0.
Bug: 879910
Change-Id: Ic6f368109a5c2f1e13a5f638c6a233769e2ad41b
Reviewed-on: https://pdfium-review.googlesource.com/41930
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I2c52828c25b4941669503328517c12a0a1dd770e
Reviewed-on: https://pdfium-review.googlesource.com/41850
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It's always passed as nullptr. It's a good thing, too, since it looks
like some of the implementations are returning a wrong pointer.
Add some missing |const|s.
Change-Id: I768048fdfe4cdd1dc838fee26fec18e024e39920
Reviewed-on: https://pdfium-review.googlesource.com/41810
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I3b6a386cf376a418ad64514313c791437ea54cf6
Reviewed-on: https://pdfium-review.googlesource.com/41610
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The bug also requires end circle to be tiny (radius of < 0.01).
Bug: pdfium:1140
Change-Id: I2b355f44f0383334b8988fe41f82cb3f587e9909
Reviewed-on: https://pdfium-review.googlesource.com/41672
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Test UnownedPtr<> and RetainPtr<>. We cannot operate against
std::unique_ptr<> because we need a copyable type. Add test for
self-reassignment on going out of scope. Move one test helper
class to testing/ so it can be shared among unit tests. Allow it
to recognize if it ever gets "destroyed", otherwise we can't be
sure Retain/Release applied in the correct order.
Change-Id: I13056094c70079f7283cbc7600948f81a64874b4
Reviewed-on: https://pdfium-review.googlesource.com/41690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Iff900bc3e1cd9c9dd6b023230c1feba78759581c
Reviewed-on: https://pdfium-review.googlesource.com/41710
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I3f811b20399efac1b511e75d950699eee7192c65
Reviewed-on: https://pdfium-review.googlesource.com/41650
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The associated bug is caused by failure to clean up context before
returing at line 740 or so. But cleanups are fragile, so instead
do not move context out of a local until success. This in turn
means passing the local to one helper rather that using the stored
value and confirming this is the only helper method invoked during
the time in which the context is not yet stored.
Bug: 879025
Change-Id: I1acb438edc28f7f4dd8acccc2461fe3a5ea7f5c8
Reviewed-on: https://pdfium-review.googlesource.com/41670
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Move some platform-specific ifdefs so the come last in each
section as it is easier to read, perhaps.
Change-Id: Ic1c2652c46ecebc63b66213735ed6d94737a7f32
Reviewed-on: https://pdfium-review.googlesource.com/41630
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Radial shading is done between two circles with their own centers and
radii. When one has a radius of 0 and is located on or very close to
the border of the other circle, a should be 0, but is not due to
rounding errors unless the circles are aligned in x or y.
Bug: pdfium:1140
Change-Id: Ief2efa91f3f16f7bed439aa471b258fa4d680acf
Reviewed-on: https://pdfium-review.googlesource.com/41590
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Second CL for naming consistency.
Bug: pdfium:1141
Change-Id: Idf0a0da52abd68648ab709997e0523ee3240c247
Reviewed-on: https://pdfium-review.googlesource.com/41531
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ib0a2bd21fe4304163cf9c080e07475e7c033c299
Reviewed-on: https://pdfium-review.googlesource.com/41570
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
These look too much like public/ FPDF functions otherwise and yet
they are not exposed anywhere beyond core/fpdfapi. Disambiguate
one method vs. top-level function usage as a result.
Bug: pdfium:1141
Change-Id: I9cfdfced90386bb9ef6b2b86f568f2e6f8ee6a5a
Reviewed-on: https://pdfium-review.googlesource.com/41530
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ie344bb37abf7dde158d03cc2897dca3588f1a5e3
Reviewed-on: https://pdfium-review.googlesource.com/41550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Then include headers in the proper order per standards, since
it will no longer trigger a presubmit warning.
Change-Id: I6bb86ac90e8fd9aed30b66dac61726f0dea8222c
Reviewed-on: https://pdfium-review.googlesource.com/41535
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Also rename .cpp file to match class name and .h file.
Modify some helper functions to operate on spans.
Move some initializations to member declarations.
Change-Id: Ie0889bda91daaef80fae6f5681f8ce068e92453b
Reviewed-on: https://pdfium-review.googlesource.com/41534
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Currently if a text extraction region begins on a non-printing
character then "" will be returned. This is the incorrect behaviour,
instead the call should scan ahead until a printing character is
found and start extracting from there. Also proactively adds a
similar check and scan for the end of the extraction region.
BUG=pdfium:1139
Change-Id: Ia2001ac89740f3d31d2bb69e8000773f8b01091b
Reviewed-on: https://pdfium-review.googlesource.com/41532
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This requires making some members unique_ptr<> to preserve the
destruction order.
Bug: 877766
Change-Id: I69e0173fdde7e9cd0d24017d6c829b9b9cf600c0
Reviewed-on: https://pdfium-review.googlesource.com/41490
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Rename .cpp file to match class and .h file (!!!)
Put initialziations into header.
Change-Id: I2cbc7608287f8df887ce186d122dcd3db2aef19b
Reviewed-on: https://pdfium-review.googlesource.com/41511
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I3dc2dd54d89858722c2aea4b9e694308796b8274
Reviewed-on: https://pdfium-review.googlesource.com/41510
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Then revert the ones that break compilation.
Fix one IWYU noticed during presubmit.
Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7
Reviewed-on: https://pdfium-review.googlesource.com/41470
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Rename GetObject() to GetArray() and remove more ToArray() calls.
Change-Id: I754ca72b32c085e1801d3cedcd291ce4d2682359
Reviewed-on: https://pdfium-review.googlesource.com/41353
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I6630ccdcce795c2f4767f5403303b5cd670c93ea
Reviewed-on: https://pdfium-review.googlesource.com/41351
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
It is not a source from which you can get CFX_DIBs, but rather a
base class from which all DIBs inherit.
Do the same thing for the CPDF_DIBSource wrapper class.
Mechanical change apart from adding a one-line comment in cfx_dibbase.h
Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184
Reviewed-on: https://pdfium-review.googlesource.com/41352
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
There are also small tweaks in tests to ensure strict order of
stack variable lifetimes.
Change-Id: Ic9d5c6a2bdd378b517be627f8e29f725bafdc2ad
Reviewed-on: https://pdfium-review.googlesource.com/41310
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Iaa3e8d88083d7ac15762ff2d5d74a378f626483c
Reviewed-on: https://pdfium-review.googlesource.com/41350
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: Ifdc931fbaecf42249351bbc78760ed2c1b6566c1
Reviewed-on: https://pdfium-review.googlesource.com/41291
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Conversion to span makes this more elegant in a number of places,
owing to std::vector directly converting to span, and the bytestring's
ToRawSpan().
Disambiguate single-argument forms to allow passing {} as
an argument.
Change-Id: Ibd5eaadca8d8cbbd589338f375c7ee8439fd3eb2
Reviewed-on: https://pdfium-review.googlesource.com/41272
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Proves we own the memory that the class will eventually free.
Change-Id: Ie9523da8db738e7478a1c73e3e1a6b24aed38442
Reviewed-on: https://pdfium-review.googlesource.com/41290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
- Remove set, but otherwise unused variables.
- Mark some pdfium_test code as V8-enabled only.
- Do not build one unit test with GCC.
Change-Id: I3f04273a7731086e08386478a62769bf06f6d8a4
Reviewed-on: https://pdfium-review.googlesource.com/41271
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL fixes instances of variable shadowing that are
discovered by turning on -Wshadow.
BUG=pdfium:1137
Change-Id: I418d50de89ecbeb12e85b23a358bc61e8f16e888
Reviewed-on: https://pdfium-review.googlesource.com/41150
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|