Age | Commit message (Collapse) | Author |
|
BUG=pdfium:690
Change-Id: I922279e4bdc8b411f47f49798155e8f9118c1396
Reviewed-on: https://pdfium-review.googlesource.com/6552
Commit-Queue: Chris Palmer <palmer@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Current behavior:
Our CPVT_GenerateAP::Generate*AP() functions do not get called as
long as the annotation dictionary has an "AP" entry.
Problem:
We always need the "N" entry in AP dictionary to display an
annotation. Even though the spec requires "AP" dictionary to have an
"N" entry for normal mode appearance, in case of a malformed pdf
with "AP" but without "N" in "AP", we won't be able to display the
annotation at all.
Fix:
Always check if "AP" has "N" entry to decide whether AP needs to be
generated. If not, then we still need to generate AP, and add to the
AP dictionary under the key "N".
Bug=pdfium:778
Change-Id: Icf0c6a681b3c8c22b0b67bf8d16ce6fefdc2c45b
Reviewed-on: https://pdfium-review.googlesource.com/6692
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
Bug: chromium:727938
Change-Id: I85fe329c9d19c1dd1303279b0a9aade2fcc3211c
Reviewed-on: https://pdfium-review.googlesource.com/6814
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
At least one nonnull entry needs to be in OCGs for it to be considered
present. See "OCGs" in table 4.49 in the PDF 1.7 spec.
Bug: pdfium:491.
Change-Id: I7eae65ba1fabff9cf1d5cea50d059a04814a3fec
Reviewed-on: https://pdfium-review.googlesource.com/6751
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes some nits in fpdf_parser_decode, especially avoiding non-const
reference parameters.
Change-Id: Ibb914850afd924bb398f886ac862f7589519ef7e
Reviewed-on: https://pdfium-review.googlesource.com/6750
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I8a17739538a9ecd63d713007550177579c0b72f0
Reviewed-on: https://pdfium-review.googlesource.com/6731
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
When a Shading is created we have both a ShadingPattern and a
ShadingObject. The ShadingPattern is a ref-counted object that is stored
in the CPDF_DocPageData. The ShadingObject, when we have a tiling
pattern parent, is stored in the CPDF_Form of the tiling pattern.
Currently during destruction it is possible for the ShadingPattern to
get cleaned up before the ShadingObject which causes the UnownedPtr
probe to fire. This CL loops over all patterns and for each Tiling
pattern forces the CPDF_Form to get cleared. This then removes the
ShadingObject before we remove the ShadingPattern.
Bug: chromium:728992
Change-Id: Ife65607aa97f69440b03028981b5575b1e297093
Reviewed-on: https://pdfium-review.googlesource.com/6651
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL uses the following algorithm for improving substitute font spacing (we
are assuming the text layout is horizontal):
* Calculate PDFWidth, the width that the PDF says the glyph should have.
* Calculate FTWidth, the width calculated by freetype for the glyph, using the
substitute font that we'll use to render it. Note that some embedded fonts have
PDFWidth == FTWidth + 1, so we consider that to be matching widths.
* If PDFWidth > FTWidth + 1 , move the x coordinate by the difference / 2 so
that the glyph is rendered in a more centered spot and the text looks better.
* If PDFWidth < FTWidth, transform the glyph horizontally by PDFWidth / FTWidth
so that the glyph gets compressed and does not overlap with surrounding glyphs.
Bug: chromium:431507
Change-Id: Ia378344253fabe44d93af4daab98bb3b7bca22de
Reviewed-on: https://pdfium-review.googlesource.com/6630
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This still won't work if the info dict is not on the first page
without first calling FPDFAvail_IsFormAvail or FPDFAvail_IsPageAvail,
as these are the methods that trigger parsing the rest of the data.
Bug: pdfium:664
Change-Id: I0b0193e415a1153dcfb8bfba0e0482da6b6ba53c
Reviewed-on: https://pdfium-review.googlesource.com/6610
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Instead of using EXPECT_EQ() and constructing a std::string.
Change-Id: I7f349f49a03b1ebbad15865f9783568f4d025d91
Reviewed-on: https://pdfium-review.googlesource.com/6670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The out_row_buffer of BMPDecompressor is made a vector. This forces the
class to have constructor/destructor. Some other members were changed
to be of size_t instead of int32_t.
Change-Id: I3f70b0322dcee2ddf9a00da7962b43f3415ba545
Reviewed-on: https://pdfium-review.googlesource.com/6691
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Ic492e8900c4a69082ff9c2384006a4e6bfa3313e
Reviewed-on: https://pdfium-review.googlesource.com/6592
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Id4cb57aaf1d045d5052869477a8c5082cab8961c
Reviewed-on: https://pdfium-review.googlesource.com/6675
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:733245
Change-Id: Ic9347e2cc245831c0b71fac1d531c33c5646ab3f
Reviewed-on: https://pdfium-review.googlesource.com/6671
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I64e32fc9226f57e1c9adff7809fabc6cd56e7a8f
Reviewed-on: https://pdfium-review.googlesource.com/6611
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL creates BMPDecompressor from a struct and moves into this class
many methods which naturally belong to it.
Change-Id: I042fac9b48d0b732ee9e43fbeb0eec6b52007dab
Reviewed-on: https://pdfium-review.googlesource.com/6511
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The path creation method begins with an open MoveTo point. If nothing
else is added, CFX_PathData::GetBoundingBox will try an OOB access in
its m_Points. This CL adds a check similar to the one in
CPDF_StreamContentParser::AddPathObject.
Change-Id: Iec7cfe3379253c021ba7d5f276306a66009f84e2
Reviewed-on: https://pdfium-review.googlesource.com/6593
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
CL [1] added the ability to set the blend mode for a page object. This
CL adds the corresponding component to GraphicsData since the blend
mode is part of ExtGSState. In addition, a test using the SetBlendMode
method is added.
[1] https://pdfium-review.googlesource.com/c/5953/
Bug: pdfium:720
Change-Id: I49120284345185c200a45cc3b37ec59f0658e2dc
Reviewed-on: https://pdfium-review.googlesource.com/6510
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
It's possible to create a stream of length 0 in a PDF document.
Currently the code will early exit and return a nullptr. This causes
issues when you want to print the given PDF as the FPDF_ImportPages code
ends up only generating up to the zero length object.
This CL allows creating streams with length 0 and updates the PDF saving
code to output a blank stream.
Bug: chromium:732380
Change-Id: I44182ba4aaac7c51284b002ba01bbc34b6bcf9e0
Reviewed-on: https://pdfium-review.googlesource.com/6490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The pal_num member of bmp_ptr indicates the number of color indices
used by the bitmap. This CL returns an error when an invalid index is
found, since otherwise a heap-buffer-overflow can occur since the size
of m_pSrcPalette is calculated based on pal_num.
Bug: chromium:616670
Change-Id: I397958704bed1aa1ae259016ffd5033c07a801ee
Reviewed-on: https://pdfium-review.googlesource.com/6470
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: If606359bd9264a6f440871ab824ab54a4efae901
Reviewed-on: https://pdfium-review.googlesource.com/6450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I6d1f59318cd63539ddce3fbdd3f0a375060b6476
Reviewed-on: https://pdfium-review.googlesource.com/6435
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:655
Change-Id: Ibf4217b35b613d21d3e8e060608b502ef79acd9e
Reviewed-on: https://pdfium-review.googlesource.com/6392
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I20c3d87dba91d1489794abb77afcd2d7e9db88fe
Reviewed-on: https://pdfium-review.googlesource.com/6393
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Instead of one general RemoveAt() method, split it into:
- RemoveAt(index)
- Truncate(nNewSize)
- Clear()
Update callers, which are now easier to understand.
Update existing unit tests and add new tests.
Change-Id: I38fe40146ce8f2479677b2caadd20a1756678768
Reviewed-on: https://pdfium-review.googlesource.com/6417
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
std::ostringstream.""
This reverts commit 53827cbbfebae66dd31f7aa30d3ee5c88716897a.
Reason for revert: Rollforward of original CL - test failures were flakes.
Original change's description:
> Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream."
>
> This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa.
>
> Reason for revert: windows_xfa_clang broke?
>
> Original change's description:
> > Adding constructor of CFX_ByteString that takes a std::ostringstream.
> >
> > Bug: pdfium:731
> > Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
> > Reviewed-on: https://pdfium-review.googlesource.com/6394
> > Reviewed-by: dsinclair <dsinclair@chromium.org>
> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
>
> TBR=dsinclair@chromium.org,hnakashima@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: pdfium:731
>
> Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0
> Reviewed-on: https://pdfium-review.googlesource.com/6395
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=dsinclair@chromium.org,pdfium-reviews@googlegroups.com,hnakashima@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:731
Change-Id: I4a31a1a6bdb128016183c1059f0bfe1fa559a89e
Reviewed-on: https://pdfium-review.googlesource.com/6434
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa.
Reason for revert: windows_xfa_clang broke?
Original change's description:
> Adding constructor of CFX_ByteString that takes a std::ostringstream.
>
> Bug: pdfium:731
> Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
> Reviewed-on: https://pdfium-review.googlesource.com/6394
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=dsinclair@chromium.org,hnakashima@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: pdfium:731
Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0
Reviewed-on: https://pdfium-review.googlesource.com/6395
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a
Reviewed-on: https://pdfium-review.googlesource.com/6394
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
If the prec value in syncc444_to_rgb is more then 30 then when we shift
left we'll go negative. The subsequent -1 will cause an overflow. This
CL early returns if the prec value is > 30.
Bug: chromium:728321
Change-Id: I4d25e9bab840bc6d46f8db3490c9484392cd7a32
Reviewed-on: https://pdfium-review.googlesource.com/6414
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Loaded PDF Reference 1-7.pdf 10 times to test performance, no apparent
changes. All measurements between 62s and 65s in all cases.
Bug: pdfium:731
Change-Id: I0a39bae45fc19a6bae0c634c5c8ef1d952ded26a
Reviewed-on: https://pdfium-review.googlesource.com/6390
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:655
Change-Id: Idd90be487d390f066a76140800096feead6b9e55
Reviewed-on: https://pdfium-review.googlesource.com/6310
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
The Contents stream of a page is optional per PDF spec 1.7 Table 3.27.
This CL fixes the empty creation test to acknowledge that.
Change-Id: I1e59a1fedbf00eafabe87962830d62d8883a5e1f
Reviewed-on: https://pdfium-review.googlesource.com/6311
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL adds tests for the date parsing and formatting code in
CFGAS_FormatString.
Change-Id: I9989cdd1b3f92c90d46ee2c3f7838fe1de255be2
Reviewed-on: https://pdfium-review.googlesource.com/6178
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I96c3429dbe2c572ed409706adfe3707b8b9bf51b
Reviewed-on: https://pdfium-review.googlesource.com/6176
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I4deaf8ca946c2dcb6842c5702b02eed1c22b1201
Reviewed-on: https://pdfium-review.googlesource.com/6191
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Introduce a base CCodec_GifModule::Context class with a virtual
destructor so holders of unique_ptr's to these can delete them
without actually having any knowledge of the implementation
details of the context.
Bug: 728669
Change-Id: Ia50f94300924a1053c326984eac3b03f25f1b83c
Reviewed-on: https://pdfium-review.googlesource.com/6190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ief386ce0d3887cc2876ce4b430f657b7462e3277
Reviewed-on: https://pdfium-review.googlesource.com/6170
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:717
R=dsinclair@chromium.org,thestig@chromium.org
Change-Id: I7e0e6fd301d40f9b5341d40cf11167b7748af243
Reviewed-on: https://pdfium-review.googlesource.com/6071
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The module class itself is already stateless.
Clean up context in its dtor.
Change-Id: Icbab7b23ec9d3ceb773b74383056c12b61a38907
Reviewed-on: https://pdfium-review.googlesource.com/6151
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Rename FXPNG_Context and use unowned ptr. Clean up context
in its dtor. Then create and destroy using |new|.
Change-Id: I7b66e6d0da50a16d3b8d5108ffd931bb01145892
Reviewed-on: https://pdfium-review.googlesource.com/6152
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This avoids a stale delegate pointer issue in the module. In theory,
it should also allow for multiple decodes at the same time from
different contexts within the same module, but this isn't used.
Rename associated context, and use |new| to create it. Along the
way, resolve a subtle FX_Alloc() vs. user-supplied callback
free() issue, and remove supporting code.
Bug: 728323
Change-Id: I7bb66bb5d5b4fa173bec2b445a8e71ab691fdf5c
Reviewed-on: https://pdfium-review.googlesource.com/6133
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I8e31305dcf888665cb0656ac518f07541566b177
Reviewed-on: https://pdfium-review.googlesource.com/6084
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Ensure the renderstatus and image renderers are gone before
trying to reset the device.
Bug: 726755
Change-Id: Id69402a90aaf6eb03f9e3e7e51ad2f735ddb92d0
Reviewed-on: https://pdfium-review.googlesource.com/6081
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Workaround for murky ownership. Note the member will now get cleared
as a consequence of Release()
Bug: 726887
Change-Id: I3eac3d1aa915497f66a57c5effa892a15d10f583
Reviewed-on: https://pdfium-review.googlesource.com/6079
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
It's passed everywhere it is needed, and there's no reason to
believe that any specific instance will outlive the context.
Bug: 727245
Change-Id: Ie902d02fc668fb5c21adb9c4d8eb329008f3a665
Reviewed-on: https://pdfium-review.googlesource.com/6078
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Avoids the possibility of having a stale pointer in the context.
Bug: 726653
Change-Id: I8b41d2ab04e7ab07e694431b53491b3d0861e4ee
Reviewed-on: https://pdfium-review.googlesource.com/6074
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Make CFX_RenderDevice, which owns the IFX_RenderDeviceDriver, responsible
for restoring driver state as part of its destruction so that its callers
don't have to do so out of turn.
Then re-order CPDF_PageRenderContext destruction order so that
the progressive renderer is destroyed before the device, and the
device destroyed before the options because of unowned pointers
to objects owned by these.
Bug: 726755
Change-Id: I9a6f23da12140b2758b86e6f33f715ad1c679c3f
Reviewed-on: https://pdfium-review.googlesource.com/6073
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:720
R=npm@chromium.org
Change-Id: I2a43b34da6946265ca06502b9ff19ad352fd18cb
Reviewed-on: https://pdfium-review.googlesource.com/5953
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Avoid holding a stale pointer to it in CJBig2_GRDProc.
Bug: 726732
Change-Id: Ia3797a3e087f61bd2126f867fd5a282e873de5bc
Reviewed-on: https://pdfium-review.googlesource.com/6050
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Colorspaces need to be properly refcounted but in the mean time,
get rid of an obvious dangling pointer.
Bug: 726728
Change-Id: I6bd879b18f61f7f5defd2679ce896013eb218b9b
Reviewed-on: https://pdfium-review.googlesource.com/6072
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|