Age | Commit message (Collapse) | Author |
|
Bug: chromium:528103
Change-Id: I990c829af8c6a9f481a34fc0e25de6814bbab34a
Reviewed-on: https://pdfium-review.googlesource.com/5633
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
CPDFXFA_DocEnvionment is part of the heirarchy of objects owned by
the embedder under its FPDF_Document object.
IJS_EventContext is part of the hierarchy of objects owned by the
embedder under its FPDF_FormHandle object.
The FPDF_Document must outlive the FPDF_FormHandle, so there is a
lifetime inversion with the m_pJSEventContext member. No matter,
event contexts are transient and allocated in a stack-based manner
as control bounces from C++ to JS and vice versa, and keeping a
persistent one seems wrong. So make it only as needed.
Bug: 723644
Change-Id: I74dd328ad4b501e4adf57821b44ecc78d945eb0f
Reviewed-on: https://pdfium-review.googlesource.com/5656
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The test, as written, is only correct for the non-xfa case, where
the FPDF_Document opaque type is equivalent to the CPDF_Document.
Under XFA, however, there is another layer of indirection that
the test harness needs to respect.
Sorry, I missed this the first time around when I signed off
on the CL that introduced this test.
Change-Id: Ida3579edf639fbfca2939dc151c0420247e90ab3
Reviewed-on: https://pdfium-review.googlesource.com/5657
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit b084c1f615e9b5d82a36aeedcff2339b7ac91265.
Reason for revert: new crashes.
BUG=723415
TBR=dsinclair@chromium.org
Change-Id: I5194170f74a5781dad213d08a28e574eb6d56156
Reviewed-on: https://pdfium-review.googlesource.com/5655
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl removes the CXFA_FMErrorInfo class. The message was never output, just
used as a flag to determine if there was an error. The class has been replaced
with a boolean.
Change-Id: I1cde99ce6957f5f8c6be0755a198d80ec8378b3a
Reviewed-on: https://pdfium-review.googlesource.com/5653
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This regressed in commit e21fe98. When the image's bpc is a multiple of
8, there exists a colorspace, and there is a Decode parameter, the image
data source was incorrectly pointing to a data structure that only
contained black pixels.
BUG=chromium:718762
Change-Id: I5d3fa739e41726b4ed1ebc16465e17f83fff9f8d
Reviewed-on: https://pdfium-review.googlesource.com/5333
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL replaces some reinterpret_cast with static_cast in fpdfsdk. It also
removes an obsolete comment in fpdfedit.h
Change-Id: I36c29bfcd6382490a8c955b50ccfa4c93ab351c7
Reviewed-on: https://pdfium-review.googlesource.com/5632
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Bug: pdfium:667
Change-Id: Ibef9a2131b97da1a1e6b9469d389aa5fb914c797
Reviewed-on: https://pdfium-review.googlesource.com/5631
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This Cl shortens the prefix applied in JavaScript to reduce the size of
the generated JavaScript string.
Change-Id: Ica5d02cc89b17140ba42deae72484cd159f8e3e5
Reviewed-on: https://pdfium-review.googlesource.com/5590
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
In particular, doing m_pPtr = nullptr; in your dtor to evade this
check will not longer work.
Fix slight mis-ordering observeds in CFX_Font and CPDFXFA_Context.
Change-Id: I3e6137159430333b091364021283a54a13d916b5
Reviewed-on: https://pdfium-review.googlesource.com/5570
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:667
Change-Id: I8c3d07d2c533e6dd2a98099673b136c587c37a98
Reviewed-on: https://pdfium-review.googlesource.com/5630
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
The ToUnicode map should not be ignored when it exists. Doing so can cause a
charcode to be assigned an incorrect glyph index, and will result in garbled
text.
Previously, some bots failed with 'unable to open' the .png file.
Bug: chromium:665467
Change-Id: I435a73647eadcc3ba37bb0120f3b5cee381ae7a3
Reviewed-on: https://pdfium-review.googlesource.com/5610
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL adds the beginning of unittests for the CXFA_Parse code.
Change-Id: I06e556f1a35405bc683c536d390071917ee330a6
Reviewed-on: https://pdfium-review.googlesource.com/5556
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug:
Change-Id: I294e765916f35ef933142789179a06ffad67fc31
Reviewed-on: https://pdfium-review.googlesource.com/5494
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
|
|
Update ftoption.h with new (unused by us) setting:
AF_CONFIG_OPTION_TT_SIZE_METRICS
Change-Id: Ia8004e1ab1e72778319d23e7dfa8cbdcbebfdd34
Reviewed-on: https://pdfium-review.googlesource.com/5555
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Most files match the contents. The expression files are named to match
their base type even though they contain all the expression
subclasses.
Change-Id: I3b7705c7b206a9fa1afae8b677f765e8b788e84d
Reviewed-on: https://pdfium-review.googlesource.com/5492
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL adds some checks to make sure the DecodeString method does not go out
out control:
If code is equal to code_table[code].prefix, it will try to loop forever.
Even if that's not the case, avoid reading a negative position from the stack.
Bug: chromium:722672
Change-Id: I638f91542ba21f3a9915198fef853cc3cf94f4f1
Reviewed-on: https://pdfium-review.googlesource.com/5513
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This reverts commit dde95d8be9bc2817e34429fc38ee6d89d6d5ab75.
Reason for revert: the test added is flaky
Original change's description:
> Small fix in CPDF_TrueTypeFont load
>
> The ToUnicode map should not be ignored when it exists. Doing so can cause a
> charcode to be assigned an incorrect glyph index, and will result in garbled
> text.
>
> Bug: chromium:665467
> Change-Id: I21c1bf560a0731d974191d4189ea730ef9868334
> Reviewed-on: https://pdfium-review.googlesource.com/5512
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Commit-Queue: Nicolás Peña <npm@chromium.org>
>
TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: chromium:665467
Change-Id: I704a34f326d31018061bcfd857fb25f7e4ee4cc2
Reviewed-on: https://pdfium-review.googlesource.com/5493
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
In particular, prefer an explicit .release() call when handing
ownership of an object to a caller across a C-API.
Change-Id: Ic3784e9d0b2d378a08d388989eaea7c9166bacd1
Reviewed-on: https://pdfium-review.googlesource.com/5470
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
So remove it.
But they probably wanted it to be true in one place, because
it looks like a leak. So find a better way to own the object.
Change-Id: I15937e29da5ce8b380f82cb20ee3ecc3f49b8ca3
Reviewed-on: https://pdfium-review.googlesource.com/5473
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The ToUnicode map should not be ignored when it exists. Doing so can cause a
charcode to be assigned an incorrect glyph index, and will result in garbled
text.
Bug: chromium:665467
Change-Id: I21c1bf560a0731d974191d4189ea730ef9868334
Reviewed-on: https://pdfium-review.googlesource.com/5512
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Ibd1ebe4191f61e20d815de7f1a1094d78b72e6a7
Reviewed-on: https://pdfium-review.googlesource.com/5391
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
There are places where an object "child" has a raw pointer
back to object "owner" with the understanding that owner will
always outlive child.
Violating this constraint can lead to use after free, but this
requires finding two paths: one that frees the objects in the
wrong order, and one that uses the object after the free. The
purpose of this patch is to detect the constraint violation
even when the second path is not hit.
We create a template that is used in place of TYPE*. It's dtor,
when a memory tool is present, goes out and probes the first
byte of the object to which it points. Used in "child", this
allows the memory tool to prove that the "owner" is still alive
at the time the child is destroyed, and hence the constraint is
never violated.
Change-Id: I2a6d696d51dda4a79ee2f00a6752965e058a6417
Reviewed-on: https://pdfium-review.googlesource.com/5475
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Limit the length of error messages to avoid string formatting failure.
Simplify some CXFA_FMParse error handling code too.
BUG=chromium:708428
Change-Id: I2f5fdb61349a90b3ba681dcc04a26ce0d7f2bdda
Reviewed-on: https://pdfium-review.googlesource.com/5331
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL adds tests for CXFA_FMLexer.
Change-Id: I4cb7000212dda6d2b32211005a1c22deabb813ae
Reviewed-on: https://pdfium-review.googlesource.com/5554
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Update return types to be bools instead of ints. Make some methods private.
Change-Id: I5d55c48a861f90e9bd116ef835c11cdb515002a6
Reviewed-on: https://pdfium-review.googlesource.com/5553
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
The fm2js code takes a pointer to the input string and then walks along
that pointer. There are currently no checks to verify we haven't walked
off the end of the pointer into random memory.
If this happens, we can end up allocating large chunks of memory and
copying random bits.
BUG=chromium:721533
Change-Id: Ia61fe96c1ff9eb9ded63cf8326b7be44986bd9e1
Reviewed-on: https://pdfium-review.googlesource.com/5550
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Remove the inc/dec/get methods that aren't helpful. Change methods to
return void instead of uint32_t and make sure they set the proper error
messages.
Change-Id: I741316e7990a776d528625f34fd941316c524c15
Reviewed-on: https://pdfium-review.googlesource.com/5530
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Add a few constants in the process.
Change-Id: Id69b939e4ea6a3de879e0a1f29d1453e95c838db
Reviewed-on: https://pdfium-review.googlesource.com/5552
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The gamma value is always 2.2, which means the table entries all point
to themselves. Remove the usage of the gamma table.
Change-Id: Idbb06015e8acd9f106f4bd1da5ef06563fb26296
Reviewed-on: https://pdfium-review.googlesource.com/5352
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The only user of CPDF_Creator is FPDF_Doc_Save, and it only uses flags 1
or 2 when calling Create. Thus, the other two flags will never be set.
Change-Id: Ib2eb0ce5585469c7749f0ab350855f1c6a2bba08
Reviewed-on: https://pdfium-review.googlesource.com/5491
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Upstream patch:
https://github.com/vadz/libtiff/commit/5a4eceed8d2f28d05f49add9ce647684d59d461a
Bug: chromium:722071
Change-Id: Idef412edbeb3255375ab18c68721dbaf7c601119
Reviewed-on: https://pdfium-review.googlesource.com/5511
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Users get confused when they set both Skia args to true and their code does not
compile. This CL adds a check for this when generating gn args.
Bug: pdfium:722
Change-Id: I0fb6f6a3fa64b094b674c602f38c736ee7b7fd65
Reviewed-on: https://pdfium-review.googlesource.com/5510
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
From the Gif spec:
'The output codes are of variable length, starting at <code size>+1 bits per
code, up to 12 bits per code. This defines a maximum code value of 4095
(0xFFF).'
'Because the LZW compression used for GIF creates a series of variable length
codes, of between 3 and 12 bits each'
Bug: chromium:722115
Change-Id: Ic9cff99e6012195a6b5173693b029dc710285688
Reviewed-on: https://pdfium-review.googlesource.com/5490
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This Cl updates CPSOutput to inherit from IFX_WriteStream and converts
the CFX_PSRenderer to accept an IFX_WriteStream instead of a CPSOutput.
Change-Id: Ibde5c7da1c2f6df0a10cb6e9a470e18fbab167b8
Reviewed-on: https://pdfium-review.googlesource.com/5431
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl allows passing a CFX_ByteStringC to IFX_WriteStream along with the
buffer method. This makes it easier to pass C-style strings to the stream.
Change-Id: I1051eb3ba17c7fbd42984c14dc60cbce24d72f3f
Reviewed-on: https://pdfium-review.googlesource.com/5430
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I519d79b2b22d2b947c546c6285195b8ca52f4993
Reviewed-on: https://pdfium-review.googlesource.com/5471
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I7586194b59d2c8e28fc24b698ea93f4a2ab636e2
Reviewed-on: https://pdfium-review.googlesource.com/5474
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes a leak that can be caused by a longjmp in ErrorData. The method
is renamed to express the fact that it includes such, and a followup should
remove the jmps altogether.
Bug: chromium:721488
Change-Id: Iefcc82a77a30ff77b7973b05611440a8d5bf275e
Reviewed-on: https://pdfium-review.googlesource.com/5450
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I60c9cbd83ff9e7a30a5a570a6ad1cf8f52360c07
Reviewed-on: https://pdfium-review.googlesource.com/5410
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I9b7a1c101e3c73d0270f9216225e5a13d9937b97
Reviewed-on: https://pdfium-review.googlesource.com/5332
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This Cl renames the CFX_RenderDevice subclasses to make their usage
clearer.
Change-Id: Ie820b57df9a3743ce8c6893fb483b398a1f1bdbe
Reviewed-on: https://pdfium-review.googlesource.com/5390
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The times we need the DC we call ::GetDC to retrieve it from the platform.
These methods are unused.
Change-Id: If83aa9b37ae2231d8029db6f2e6d8d17f1825611
Reviewed-on: https://pdfium-review.googlesource.com/5350
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The FPDF_LoadDocument call was missing the CheckUnSupportedError so, if
the document contained unsuppoted information the user would not be
notified. This brings the method in line with the other loading methods.
Change-Id: I308b25335a228eb02c51562f9caf91cda9193b73
Reviewed-on: https://pdfium-review.googlesource.com/5336
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Before, all pointers were being initialized to 0. After raw pointers were
changed to vectors, data() was used in some cases, but now no longer returns
nullptr when it is supposed to. This CL fixes that.
Bug: chromium:721417
Change-Id: Ia31b75b18dc17d7eed48538145fe5d0d59668843
Reviewed-on: https://pdfium-review.googlesource.com/5353
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This Cl consolidates the code to load maps and codecs into the
CPDF_ModuleMgr class instead of putting it directly into fpdfview.
Change-Id: Ia08f212f43a33e51ab1c7832051ee4f28eecb50d
Reviewed-on: https://pdfium-review.googlesource.com/5335
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ibd8d70264d79afc0baabaa5093aceb21ee777196
Reviewed-on: https://pdfium-review.googlesource.com/5334
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
In AGG, len is of type coord_type, which we have as int16_t, but we can add to
it large values, causing it to become negative. Stop the rendering when that
occurs.
Bug: chromium:719258
Change-Id: Ic7497666b01220a9cd3e7d749f1fc6ae4a210870
Reviewed-on: https://pdfium-review.googlesource.com/5370
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
bpno_plus_one is used as a parameter bpno for a bunch of methods that calculate
1 << bpno. Thus, use a reduced value when it's large enough to cause undefined
shift. bpno_plus_one itself remains unchanged so that the number of calls
remains the same
Bug: chromium:698526
Change-Id: I40431d41a04f3e2315bd3c80114cd0fcbd2815b4
Reviewed-on: https://pdfium-review.googlesource.com/5310
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
BUG=chromium:665087,chromium:718492
Change-Id: I09e93b4167ab2c0b3b53641243aa0cbeb5b98c4f
Reviewed-on: https://pdfium-review.googlesource.com/3114
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|