Age | Commit message (Collapse) | Author |
|
Pre-cursor to using more std::vector<uint8_t> as byte buffers.
The widestring test case is more complicated, where we're not sure
of having any particular uint*_t type to match wchar_t.
Change-Id: Ic27980f16cdbc61fac7c11f39a85eea58d19bacb
Reviewed-on: https://pdfium-review.googlesource.com/4153
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Remove member m_pAcroForm as it is only used in one method,
and immediately set upon entry. A local will be fine here.
Change-Id: I373f68252249a248061828530098ad759907259a
Reviewed-on: https://pdfium-review.googlesource.com/4190
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Prototype should be in header for .cpp file actually
implementing it.
Change-Id: I8f771a4840e09da419cee384e3d6dc2e7bba1cc4
Reviewed-on: https://pdfium-review.googlesource.com/4170
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
In a way similar to the existing USE_SYSTEM_LIBJPEG. The default is of
course still the DEPS-based zlib checkout.
Change-Id: I649e75beb1a19c4cf7abda42fa10ebe5babfe946
Reviewed-on: https://pdfium-review.googlesource.com/4070
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Avoid tracking ownership via m_bLocalCryptoHandler.
Also remove m_bEncryptCloned, as it is always false.
Replace some methods with direct calls to underlying code.
Change-Id: Ifa9d6f721c59d07e3b8e258f76832ca9f2ea0fc9
Reviewed-on: https://pdfium-review.googlesource.com/4111
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Skia tracks the font passed so it can
use it later to draw. In XFA's case,
the font is discarded after Skia sees it,
but before it draws with it.
Track the TypeFace instead, which
remains available across the XFA
lifetime.
R=dsinclair@chromium.org
Bug: 705193
Change-Id: I4fc9fee4a7d96ea25f242975f6c0d10941f5c549
Reviewed-on: https://pdfium-review.googlesource.com/4058
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL applies several fixes to the fallback font code.
- PDFium uses -1 to indicate that no glyph index was found, but freetype uses
0. In CPDF_TrueTypeFont, an index of 0 indicates a freetype failure, which
means we should try to find the glyph from a fallback font.
- Improve the fallback glyph calculation by going from original font charcode
to unicode to fallback font charcode.
- Consider the m_ExtGID on Mac when deciding the fallback.
Bug: chromium:665467
Change-Id: I2be34983e0d768d9a598043f84edd2d70f033c86
Reviewed-on: https://pdfium-review.googlesource.com/4055
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
If a clip with bounds (0, 0, 0, 0) is used to specify
the limits of a gradient, the clipping rectangle will
be degenerate.
Leave the clip empty in this case.
R=dsinclair@chromium.org
Bug: 705736
Change-Id: I4a5845459c1527f2c643563d6bef4d6dcc6781d3
Reviewed-on: https://pdfium-review.googlesource.com/4071
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Cary Clark <caryclark@google.com>
|
|
To help find future bugs, add printf and checking
to see that the skia clip stack and the pdfium
clip stack are in sync.
Bug: 705783,795821
Change-Id: I3ed39cbe2514ab18e5bee6eb363cc2d0f042bff5
Reviewed-on: https://pdfium-review.googlesource.com/4090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The pointer members point to owned arrays. Avoid FX_Free in CFX_Palette.
Use std::pair and avoid the use of a buggy quicksort.
Change-Id: I5d5471d56dbfd32800e204c84664c436d1fbab08
Reviewed-on: https://pdfium-review.googlesource.com/4038
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
It's possible for the nVal to become negative as it is shifted. This Cl
changes nVal to be a checked_numeric and bails out if the shift is invalid.
Bug: chromium:708504
Change-Id: Ia2ebbc828ece7f7d443432542784b39defe6a897
Reviewed-on: https://pdfium-review.googlesource.com/4010
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
It's possible for the RANGELEN[NTEMP] value to be larger then 32. This
will make the shift invalid if the 1 is an int. This CL changes to 1L
and uses the CheckedNumeric to validate that the result is inside the
needed range for an int.
Bug: chromium:708439
Change-Id: I1f0359985c2d7769367bd0edcf5e081f5bb58816
Reviewed-on: https://pdfium-review.googlesource.com/3991
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Depending on the code table, it's possible to have the largest PREFLEN
value in the huffman table to be > 32. This will, potentially, cause the
calcuation of ((FIRSTCODE[i - 1] + LENCOUNT[i - 1]) << 1 to overflow the
int value and cause a negative shift.
This Cl checks the shift value and failes the initialization if we would
shift a negative value.
Bug: chromium:709781
Change-Id: Ia165a01ba9412e31c5e5a43717d415fcb42eafe5
Reviewed-on: https://pdfium-review.googlesource.com/3990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change pass by reference to const reference or pointer.
Change-Id: Ic007f14e6569679a846980a96cc627eac4ecd5d6
Reviewed-on: https://pdfium-review.googlesource.com/3953
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
m_Transparency is set in the Init method of the CFX_ScanlineCompositor. After
the removal of the icc transform, it is clear that m_Transparency can only take
values strictly less than 64.
Change-Id: I6c33b9971b3b8a1ec45fbf50901f9815f323a2a5
Reviewed-on: https://pdfium-review.googlesource.com/3970
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL adds the ability to extract the title from a tagged structure element if
one exists.
Bug: pdfium:672
Change-Id: I22e2a8371db4f08b8a70dd77002f1befab97f530
Reviewed-on: https://pdfium-review.googlesource.com/3819
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Also use safe arithmetic for two-arg ctor.
Change-Id: I5d541d9b2d5fe5b939f4cc8c22cf034f5cb01176
Reviewed-on: https://pdfium-review.googlesource.com/3955
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Return strings where possible.
Add missing consts to strings passed by ref.
Convert non-const cases to pointers.
Rename a few methods to be clearer.
Change-Id: I86569bc1744f539e6dd67fc73649b272c016328c
Reviewed-on: https://pdfium-review.googlesource.com/3951
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Pass in/out argument as a pointer.
Avoid pointless malloc just to copy in multibyte case. Then we can
avoid special-casing the single-byte case.
Change-Id: I3dd2d57e08ef6ad7b78ea38398b228fa41a9b3e6
Reviewed-on: https://pdfium-review.googlesource.com/3950
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
- All callers of CFX_DIBitmap methods use nullptr as the ICC Transform.
- The CFX_ScanlineCompositor is always initialized with a null ICC transform.
Many of its methods call TranslateScanline from the ICC module. This method
casts just uses ((CLcmsCmm*)pTransform)->m_hTransform, and this should not be
done when pTransform is nullptr.
Change-Id: I1b846d1f20699fa017cb9a276be3214eb8fabd4b
Reviewed-on: https://pdfium-review.googlesource.com/3931
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Repeated looping over Realloc() with a linearly increasing buffer
size is going to be O(N^2) which is why it was limited to small
cases. But it's wrong to do it anyways, and it kicks out a
lurking issue in PartitionAlloc as it turns out.
See https://crbug.com/709271, but this doesn't actually fix that
issue, it just avoids it.
Change-Id: I39d8f8df0d5fc358b7b9caa15c507a8f57e45004
Reviewed-on: https://pdfium-review.googlesource.com/3910
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ia4181a2838de60e4e177165b3689338c86f45771
Reviewed-on: https://pdfium-review.googlesource.com/3817
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Tests need to be subclasses of FPDF_Test.
BUG=pdfium:700
Change-Id: I317ec2c49567e58cb57c6222e387574226f594b3
Reviewed-on: https://pdfium-review.googlesource.com/3890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
|
|
Remove default params, use more unique_ptr, and fix some nits.
Change-Id: I4ed9a576fb3ebd9afd64c6544d1f6a1103e9d270
Reviewed-on: https://pdfium-review.googlesource.com/3872
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I1e0b84a8b208d92aff3f02b6461b3a20f60f4d1e
Reviewed-on: https://pdfium-review.googlesource.com/3870
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This Cl removes a bunch of unused tagged code. Some of this will need to come
back in the future (like the attr code) but we can add it back with tests when
needed.
Bug: pdfium:672
Change-Id: I7aaed79963910b336f42ce665790408038c39ba4
Reviewed-on: https://pdfium-review.googlesource.com/3830
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the IPDF_Struct* classes in favour of their only implementation.
The tagged code was split out into files matching the classes they contain. The
friendship between CPDF_StructTree and CPDF_StructElement was broken in favour
of accessors.
Bug: pdfium:672
Change-Id: Iade83b608fb7168b3b0f41338d10d5fd8ab91a6e
Reviewed-on: https://pdfium-review.googlesource.com/3820
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl removes the reference to the length of the CFX_BlockBuffer that
was stored and manipulated in CFDE_XMLSyntaxParser. Methods have been
added to BlockBuffer to satisify the usages in the syntax parser.
Change-Id: I1107c343ce267283c4c45aa3ae1bbfa93c24079f
Reviewed-on: https://pdfium-review.googlesource.com/3816
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I149718bbdb7195223012150d6162d73cbeb3b8cc
Reviewed-on: https://pdfium-review.googlesource.com/3813
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
If windows is unable to resolve the font stream,
use the custom empty handler instead, which
maps to freetype.
R=dsinclair@chromium.org,bungeman@google.com
Bug:chrome:705580
Change-Id: Ib1732f29f462fc5d5e42329088c80c83abe3ea25
Reviewed-on: https://pdfium-review.googlesource.com/3771
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Cary Clark <caryclark@google.com>
|
|
Sigh, messed up std::min conversion.
TBR=npm@chromium.org
Bug: pdfium:697
Change-Id: I0091f178b08fa537ebc3962d9349eb46d0aa8a80
Reviewed-on: https://pdfium-review.googlesource.com/3751
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
When fixing https://crbug.com/672177 we added a guard that we aren't
reading off the end of the file. That guard used the file access
Position(). This is the wrong value to compare against as our read
position and the file access Position may be different. This CL updates
the check to use the correct current file position.
Bug: pdfium:697
Change-Id: I68a5eaed2f1f3d65422605f0a8474144cfa7d172
Reviewed-on: https://pdfium-review.googlesource.com/3711
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Combine some common CCodec_Jbig2Module code.
Change-Id: I9a046314bc0e9dddc9a8c1a06b37764e9f3cc4b6
Reviewed-on: https://pdfium-review.googlesource.com/3713
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL removes dib_int.h by moving CStretchEngine to its own file, other
classes to where they are used, and the remaining to fx_dib.h.
Change-Id: Ie2d4bb39389737cd631f92b88000ea942608da21
Reviewed-on: https://pdfium-review.googlesource.com/3714
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Pass stream argument to constructor; it feels like a
stream accessor should always be made from a stream rather
than passing one in after the fact.
Change-Id: Iaa46cb37677b81f0170f5d39bab76ad38ea4af44
Reviewed-on: https://pdfium-review.googlesource.com/3620
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Instead of storing the same constants as strings and converting them to
uint64_t.
Change-Id: Ib32b0f721303f917e197cf93999857a7ee745823
Reviewed-on: https://pdfium-review.googlesource.com/3621
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL cleans up default parameters, return values and bits of code
formatting in the CFX_BlockBuffer code.
Change-Id: Ie7fd7d86046f716d0786213735ad464eefc58dbb
Reviewed-on: https://pdfium-review.googlesource.com/3670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL avoids some void* usage and removes CancelDIBits after making a
CPDF_ImageRenderer own its CFX_ImageRenderer.
Bug: pdfium:686
Change-Id: Ied205c57a858cc14d8e2c592db3444ed465b2796
Reviewed-on: https://pdfium-review.googlesource.com/3673
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Make the IccProfile track its stream so that it has a
proper key with which to purge the docpagedata map.
Change-Id: Ib05ebc1afb828f1f5e5df62a1a33a1bfdecf507d
Reviewed-on: https://pdfium-review.googlesource.com/3619
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
After this CL, fx_dib.h only has some definitions used in multiple places.
Definitions that were of restricted usage were moved out to the corresponding
place. Includes in fx_dib were reduced, thus revealing other needed includes.
Change-Id: I3607da0af81c491256d64c0aa085225631efbdcc
Reviewed-on: https://pdfium-review.googlesource.com/3594
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Icf6b0ec88dfc8dc707b18ca4ad25dd77610b4c91
Reviewed-on: https://pdfium-review.googlesource.com/3622
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Move as much as possible into anonymous namespaces.
BUG=pdfium:388
Change-Id: I7cca042736372c52105ed2ef1f9945a8d72c3db2
Reviewed-on: https://pdfium-review.googlesource.com/3557
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Iaea91df0300b55e35cbfd9b3f3389b3e291eae9b
Reviewed-on: https://pdfium-review.googlesource.com/3618
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Prefer internal refcounts to external scheme.
Change-Id: Ia99d5fc635a51a38f41b1d64ea44d8202685ddc7
Reviewed-on: https://pdfium-review.googlesource.com/3617
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Prefer internal reference counts over ad-hoc schemes.
Change-Id: I8d420e9e9827ac39fdc0bc8146a532caeee10f26
Reviewed-on: https://pdfium-review.googlesource.com/3615
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This Cl splits the fde_xml_int file apart into individual class files.
Includes are fixed as needed. fde_xml.h is also removed and the needed
defines moved to more appropiate places.
Change-Id: I29774dabc4d0fb2d5092fcbbe7853f03401b6ec7
Reviewed-on: https://pdfium-review.googlesource.com/3616
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl drops the FXSYS_ from utility methods which are the same on all
platforms.
Bug: pdfium:694
Change-Id: I0859b60c5ba7af68c929a519dd76f48c27a6c896
Reviewed-on: https://pdfium-review.googlesource.com/3614
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl drops the FXSYS_ from mem methods which are the same on all
platforms.
Bug: pdfium:694
Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236
Reviewed-on: https://pdfium-review.googlesource.com/3613
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl drops the FXSYS_ from wide string methods which are the same on
all platforms.
Bug: pdfium:694
Change-Id: I46a7af5913e7897f7c4ba712a76540c12105818f
Reviewed-on: https://pdfium-review.googlesource.com/3611
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl drops the FXSYS_ from file methods which are the same on all
platforms.
Bug: pdfium:694
Change-Id: I095c64fed69bf70e00a2594fa94a1fdc71a7060e
Reviewed-on: https://pdfium-review.googlesource.com/3610
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|