Age | Commit message (Collapse) | Author |
|
Specifically the index parameter passed in to GetAt(), SetAt() and
operator[] are now being tested to be in bounds.
BUG=chromium:752480, pdfium:828
Change-Id: I9e94d58c98a8eaaaae53cd0e3ffe2123ea17d8c4
Reviewed-on: https://pdfium-review.googlesource.com/10651
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:857
Change-Id: Ic1fb12459cad79b45466df10a24fe6743377ae14
Reviewed-on: https://pdfium-review.googlesource.com/10612
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL removes CFDE_Path. There is only one method, AddLine which is
required, the rest can be removed. That method is moved to CFX_PathData
which is what CFDE_Path is appending to anyway.
Change-Id: If50af8cf856a9f7379791fe1999174db5fd13e38
Reviewed-on: https://pdfium-review.googlesource.com/10454
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I5f240cb0779648dc5427fecb5561086e7c0fb16a
Reviewed-on: https://pdfium-review.googlesource.com/10650
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Iec5523492eac3910f5ed105370e9092fd992b1b9
Reviewed-on: https://pdfium-review.googlesource.com/10471
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I782379cc7f93b93ed34a5d0a39ee2f198c650465
Reviewed-on: https://pdfium-review.googlesource.com/10430
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Also making CFX_ByteString(ostringstream) const.
Bug: pdfium:731
Change-Id: Iaee610248a5634e8731eaf05944c32d52c4e8015
Reviewed-on: https://pdfium-review.googlesource.com/10151
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change the CPDFParserEmbeddertest.Feature_Linearized_Loading test case
into FPDFViewEmbeddertest.LinearizedDocument, and add a call to
FPDF_GetFileVersion().
Change-Id: I0272c1e71c6f61393838bd3db41b154c4f5620ba
Reviewed-on: https://pdfium-review.googlesource.com/10450
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
The CPDF_Parser::IsVersionUpdated is not used anymore.
Change-Id: I896c42daca3c5bed7b9d700eaea6ced686ab5acb
Reviewed-on: https://pdfium-review.googlesource.com/10490
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Move syntax parser initialization in separate method.
Change-Id: I701284b1fee26a474c24ca68948a3462cc68faec
Reviewed-on: https://pdfium-review.googlesource.com/10291
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
In the original code the method of writing of objects depends on a much unpredictable factors:
as:
1) Is there an updated version of the at least one object in the document.
2) The password is changed.
3) Was this object loaded earlier.
4) The Object is compressed and document have a password.
With these factors it is difficult to predict what will be the final file.
To reduce volatility use only one method that works in all cases mentioned.
This method is parse then serialize.
Change-Id: I3d7dcadd10abffbad68d1f993f2dd60b039ed989
Reviewed-on: https://pdfium-review.googlesource.com/9572
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I9ee1da4d0a9751dae8d595b610cf77c074c22cdc
Reviewed-on: https://pdfium-review.googlesource.com/10350
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This CL moves the cfx_cssdatatable tables and methods which are only
used in cfx_cssdeclaration to an anonymous namespace.
Change-Id: Ib5dc71cc85c348e2ae7feaab8d6495fc2aa88642
Reviewed-on: https://pdfium-review.googlesource.com/9253
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I2cb20fd00436858f035f984fc104bae2c2d01057
Reviewed-on: https://pdfium-review.googlesource.com/9252
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I7fe8dcd8854e2f08b7b0ee53bde6c864108142ff
Reviewed-on: https://pdfium-review.googlesource.com/9571
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The xfa/fde/css code has no other links into xfa/. This CL moves the css
code to core/fxcrt/css and sets to only build when pdf_enable_xfa is
enabled.
Change-Id: Iefd208e1f83a28b80b567c574e841e87bce310be
Reviewed-on: https://pdfium-review.googlesource.com/9251
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Single no-op callback.
pdfium::clamp() where appropriate.
Use post-increment where appropriate.
Add helper functions for image type.
Change-Id: I1584a1c90b46bd87f6ee983b78b6a2119212d0fb
Reviewed-on: https://pdfium-review.googlesource.com/10270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Mechanical change to bring into conformance with style guide.
Change-Id: I80d06708ed5c40af7e797ea5dc6279a0b4f3cf6a
Reviewed-on: https://pdfium-review.googlesource.com/10250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Apply patch suggestions from reporter. Move all FX_Alloc'd memory
into unique_ptrs so that no bare FX_Alloc/Free_Free calls remain.
Fix a realloc / opj_realloc mismatch. Remove unused functions
color_apply_icc_profile() and color_apply_conversion(). Tidy along
the way, add some missing statics, and fix a confusing (but not quite
member shadowing) local name.
Bug: 752829
Change-Id: Ibf2d108a857e3de39e752c2c553a31e002a07caf
Reviewed-on: https://pdfium-review.googlesource.com/10230
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
New version of the CL that include fpdf_parser_utility.cpp where
there is an overload for CFX_ByteTextBuf << CPDF_Object* used by
CFDF_Document.
Bug: pdfium:731
Change-Id: I54f4e9ee7e10e94388f6f6584f3999f43689e84c
Reviewed-on: https://pdfium-review.googlesource.com/10170
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Remove ifdef'd code for versions we know will no longer work.
Change-Id: I036c80168f846df1b98e9df4972f84655e8418fb
Reviewed-on: https://pdfium-review.googlesource.com/10051
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit aea80dcc0abc0c310316fa502f91a359bc684758.
Reason for revert: WriteBuf's behavior was altered
Original change's description:
> Remove CFX_ByteTextBuf from cpdfsdk_interform.cpp and others.
>
> Bug: pdfium:731
> Change-Id: I61d38ab3f2b0ac68b8479ade25bab50f3a73c27b
> Reviewed-on: https://pdfium-review.googlesource.com/9770
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
TBR=tsepez@chromium.org,hnakashima@chromium.org,rharrison@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: pdfium:731
Change-Id: Ic66a2641c259173fb3792f7a4206e19ee4707fc9
Reviewed-on: https://pdfium-review.googlesource.com/10150
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I95d7c16e6c30e6675a17505359b5b7ae1dd5ff12
Reviewed-on: https://pdfium-review.googlesource.com/9950
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Added FPDFImageObj_GetImageDataDecoded() for retrieving the uncompressed
data of an image, and FPDFImageObj_GetImageDataRaw() for retrieving the
raw data of an image.
* Refactored out DecodeStreamMaybeCopyAndReturnLength(), which is
used to decode both attachment data and image data.
* Within DecodeStreamMaybeCopyAndReturnLength(), used a different
decoder function which takes care of multiple filters if exist. As
a result, CPDF_StreamParser::DecodeInlineStream() which was made
static previously is now moved back into namespace.
Bug=pdfium:677
Change-Id: I22a22c99acaca98ef8c15f88911f2646a2c854d5
Reviewed-on: https://pdfium-review.googlesource.com/9811
Commit-Queue: Jane Liu <janeliulwq@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Added FPDFImageObj_GetBitmap() that returns the bitmap of an image
object, and a FPDFBitmap_GetFormat() that returns the format of a
bitmap.
* Fixed a small bitmap conversion bug in cfx_dibsource.cpp.
* Enabled EmbedderTest::CompareBitmap() to support different formats
of bitmaps.
* Added an embedder test and a test PDF file with images of many
different formats.
Bug=pdfium:677
Change-Id: I6a72f9d969cf5f3577db9400ca33197c213622ed
Reviewed-on: https://pdfium-review.googlesource.com/9690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
There isn't any work to NaCl PDFium at the moment, and it would
take a lot more than these few changes.
Change-Id: I6c4bf5f38bbfb9cf4f5a5688128c7720c38a8ce4
Reviewed-on: https://pdfium-review.googlesource.com/10050
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The only non-test caller is gone.
Change-Id: I261bc6d97c3047b2935d7b663c1a5f7d15670714
Reviewed-on: https://pdfium-review.googlesource.com/10010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
It is not needed to fix https://crbug.com/552046 and it causes different
bug.
BUG=chromium:750993
Change-Id: I11627045bd3e73fb439884c3362ab1c26eb95fe3
Reviewed-on: https://pdfium-review.googlesource.com/9990
Reviewed-by: Oliver Chang <ochang@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CPDF_Parser::StartLinearizedParse() calls StartParse(), but already
knows the PDF header offset. Refactor StartParse() so it does not have
to look for the header again.
Change-Id: Id8cc39301ae72da868dafc53921622d5b28ce26e
Reviewed-on: https://pdfium-review.googlesource.com/9830
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
|
|
Bug: pdfium:731
Change-Id: Iac887a8d3485b5511ec7f3d809efeb8af6ea9ce7
Reviewed-on: https://pdfium-review.googlesource.com/9930
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I63532e06aa2c135f34a6adda24ae1cfbc5922ac9
Reviewed-on: https://pdfium-review.googlesource.com/9871
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
A helper method for FromUnicode existed that converted wchar_t* to
CFX_WideString before calling the remaining FromUnicode. This method
is not used in the code base, so it has been removed. This simplifies
converting FX_STRSIZE to be unsigned, since one of parameters to this
method was of type FX_STRSIZE.
BUG=pdfium:828
Change-Id: I3da677b84ac3b82ba48497e26d2ac80dd14302e6
Reviewed-on: https://pdfium-review.googlesource.com/9910
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I7e3d45263a0bae61fd86fd4c3710de7fc0b9347d
Reviewed-on: https://pdfium-review.googlesource.com/9290
Reviewed-by: Wei Li <weili@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
All of the call sites for this method used the default value, so it
has been removed. This simplifies converting FX_STRSIZE to be
unsigned, since the removed parameter was of this type.
BUG=pdfium:828
Change-Id: I369285aed561731ab34ec6d30de0d21fb3431492
Reviewed-on: https://pdfium-review.googlesource.com/9891
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The existing implementation of Delete on the string classes handles
some cases where the range being deleted is out of bounds by clipping
it to the valid range. This behaviour can lead to programming problems
in the calling code being masked by the fact the Delete method still
does something. The new version of these methods does an early return
if the parameters are invalid.
This change also effectively removes support for negative string sizes
from the Delete method, so converting FX_STRSIZE to be unsigned will
be easier.
BUG=pdfium:828
Change-Id: Idbb4a62f70a75eba06e7809e011b25da2d7404c4
Reviewed-on: https://pdfium-review.googlesource.com/9890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The existing behaviour was to clamp the provided index to the valid
bounds. This would lead to programming errors being hidden, since
inserting would still do something even if the index calculation was
wrong. The behaviour of these methods has been changed to instead
early return when this occurs, returning the old length value. The
caller can check if the call to Insert actually did anything by
comparing the returned value to the length before calling insert.
All of the existing calls to Insert have been tested by running all of
the tests with asserts in the Insert method to check the index is in
bounds. Additionally the call sites have been manually inspected. The
majority of them are of the form Insert(0, foo) and the rest tend to
be in a loop advancing from 0 to length.
Convenience methods InsertAtFront/InsertAtBack have been added to
handle calling Insert when the intent is for the character to be added
to the beginning or end of the string. Existing call sites to Insert
that do this have been converted.
This work was originally being performed to check if there would be
any issues in these methods with making FX_STRSIZE unsigned.
BUG=pdfium:828
Change-Id: I60cee5ad45338aa8ed46569de7bcc78a76db18f7
Reviewed-on: https://pdfium-review.googlesource.com/9870
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Instead of passing in a CPDF_PageObject* and then converting it to an
image, which is always what it is.
Change-Id: I146a476147f4b344417982b5ace002b9bd7b3d80
Reviewed-on: https://pdfium-review.googlesource.com/9810
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Callers removed in commit 4b78b18.
Change-Id: I6eec6ba18712040180b12d56b59c6a8379de4379
Reviewed-on: https://pdfium-review.googlesource.com/9750
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:731
Change-Id: I61d38ab3f2b0ac68b8479ade25bab50f3a73c27b
Reviewed-on: https://pdfium-review.googlesource.com/9770
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I5deb6049db41387ac030a6ba5296ee6187120190
Reviewed-on: https://pdfium-review.googlesource.com/9470
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Make CPDF_Parser::ObjectInfo::pos a union, since the data is used as an
object number when the object is compressed.
Change-Id: Id7c32759f7411cc80285bb7f3088b5aa6ff5bf05
Reviewed-on: https://pdfium-review.googlesource.com/9570
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Helper for validate read problems locally,
Change-Id: I2bfbbaab8a67c0fd0cee3dadcd0f9cad5953101c
Reviewed-on: https://pdfium-review.googlesource.com/9552
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Fixes potential leaks in CPDF_Creator::WriteOldIndirectObject(), the
only caller.
Change-Id: I8a20da8a555c8d28f3bcd467a193a6a81c9f91d9
Reviewed-on: https://pdfium-review.googlesource.com/9751
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Iab34de5858ae06582023be220ef7dd0d1d0a91c9
Reviewed-on: https://pdfium-review.googlesource.com/9530
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL removes the default param value for this method, which was
negative. It also adds in a method to get buffer lengths, so that the
callsites can explictly passing in the length of the buffer if they
were using the default value previously.
BUG=pdfium:828
Change-Id: I0170771ee81970b8b601631015ab3e6e39fea8ea
Reviewed-on: https://pdfium-review.googlesource.com/9790
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently Find() and other methods that return a FX_STRSIZE return -1
to indicate error/failure. This means that there is a lot of magic
numbers and magic checks floating around. The standard library for
similar operations uses a npos constant. This CL implements
FX_STRNPOS, and replaces usages of magic number checking. It also does
some type cleanup along the way where it was obvious that FX_STRSIZE
should be being used.
Removing the magic numbers should make eventually changing FX_STRSIZE
to be unsigned easier in the future.
BUG=pdfium:828
Change-Id: I67e481e44cf2f75a1698afa8fbee4f375a74c490
Reviewed-on: https://pdfium-review.googlesource.com/9651
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I52e668ca410a0c6b96a789ecc18c993152047ead
Reviewed-on: https://pdfium-review.googlesource.com/9550
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:839
Change-Id: I3a069bf7d8a75f32cf9bcc9e9926ad19aa006795
Reviewed-on: https://pdfium-review.googlesource.com/9650
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Instead of accessing the raw kTextLayoutCodeProperties data.
Change-Id: Ie39cf5c098e1564ae2f18d76b234af42f24db4ca
Reviewed-on: https://pdfium-review.googlesource.com/9451
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: I94b2e8f6fd522b97c917037e32fb3bcbeea0cbeb
Reviewed-on: https://pdfium-review.googlesource.com/8911
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|