Age | Commit message (Collapse) | Author |
|
BUG=chromium:845117
Change-Id: Id1c97bc40ff776f52011a8ab2d6e5166cd7c64c8
Reviewed-on: https://pdfium-review.googlesource.com/33650
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This is a manual revert of the CL at:
https://pdfium-review.googlesource.com/c/pdfium/+/32159
The only file manually changed was cpdf_renderstatus.cpp
Reason for revert: the bug below shows that sometimes the vector size
used is larger than the parameter given to CFX_FixedBufGrow. Thus, we
will revert, then add vectors using std::max unless it's clear from the
code that the code will never access indices outside.
Bug: chromium:847247
Change-Id: Iee54af023c8564824418a7d34a6385b0bc418ff0
Reviewed-on: https://pdfium-review.googlesource.com/33050
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Abstract GetUserPermissions() differences via new virtual method.
Abstract GetPageCount() differences via existing virtual method.
Remove unused ReadHeader() form for non-xfa.
Remove unused FindSubstFontByUnicode() for xfa.
Remove unused FXFONT_EXACTMATCH
Change-Id: I0a3de01a9841db86fcbc96991d3fa2682393b9ad
Reviewed-on: https://pdfium-review.googlesource.com/32831
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
In CCodec_FaxDecoder::v_GetNextLine(), a fixed size vector often needs
to be inverted. Doing so without checking bounds on every access makes a
big difference in non-optimized builds.
BUG=chromium:843899
Change-Id: Iecc0a3da22631a289745245563dab7a7c3c458d0
Reviewed-on: https://pdfium-review.googlesource.com/32744
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Import Chromium's base/compiler_specific.h from r537069.
Now that FALLTHROUGH is available via compiler_specific.h, remove
FX_FALLTHROUGH.
Change-Id: I8b9631a4f007673e10e0c26951dfd61e9dcada30
Reviewed-on: https://pdfium-review.googlesource.com/32639
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:1085
Change-Id: I62c526ae865f0cadfddd2e75a616bce73de0f88d
Reviewed-on: https://pdfium-review.googlesource.com/32632
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ibbc020393e38405f9d1cb0d483ef875777d4e721
Reviewed-on: https://pdfium-review.googlesource.com/32650
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
FindBit() is called frequently by other fax codec code. Use 16 more
bytes of space to store the two possible values memset() can set.
Change-Id: Ibeb549c44928bbb468ac4eb4cef2d9339cf6490d
Reviewed-on: https://pdfium-review.googlesource.com/32630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Use the same limit as JBIG2 codecs.
BUG=chromium:834633
Change-Id: I11d12c841e10ab48fd85df792bf8a034fe40493c
Reviewed-on: https://pdfium-review.googlesource.com/32514
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
In case there are long runs of data to be skipped, FindBit() runs much
faster reading and comparing 8 bytes at a time.
BUG=chromium:834633
Change-Id: Ifc7b348d123c5a72cf09fbf53d764075f8abfba0
Reviewed-on: https://pdfium-review.googlesource.com/32513
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Cleaning up some nits that came in after my previous codec CL had gone
into the CQ.
BUG=pdfium:1080
Change-Id: I3845136d370f73c9c96ef732e95b8cf0c9c79d91
Reviewed-on: https://pdfium-review.googlesource.com/32351
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently all of the BMP related code is being built when support for
the codec is disabled, it just isn't being utilized. Depending on the
settings being used, this unneeded code may or may not get stripped
during linking.
This CL explicitly turns off building the BMP codec code if support
for BMP is turned off.
BUG=pdfium:1080
Change-Id: I56d40639a5a3631f9c601a1eef3f98873feac94f
Reviewed-on: https://pdfium-review.googlesource.com/32370
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CJBig2_Context return methods as follows:
* Internal methods return JBig2_Result instead of int.
* Public methods return a bool (for success/failure) instead of int.
In a followup, several of the enum class values may be merged together
since they are not all needed.
Change-Id: Ifdab83b8037262370cd7c4a80e94aa94d59aa589
Reviewed-on: https://pdfium-review.googlesource.com/32310
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Currently all of the GIF related code is being built when support for
the codec is disabled, it just isn't being utilized. Depending on the
settings being used, this unneeded code may or may not get stripped
during linking.
This CL explicitly turns off building the GIF codec code if support
for GIF is turned off.
This also catches a few missed cases from previous CLs.
BUG=pdfium:1080
Change-Id: Ie7fe2d894d2ae2f8f36ae05e0ff256f2ce6ef8d4
Reviewed-on: https://pdfium-review.googlesource.com/32330
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently all of the PNG related code is being built when support for
the codec is disabled, it just isn't being utilized. Depending on the
settings being used, this unneeded code may or may not get stripped
during linking.
This CL explicitly turns off building the PNG codec code if support
for PNG is turned off.
BUG=pdfium:1080
Change-Id: I9c5247145fcadbcb1bd2243aa83350304ba421ff
Reviewed-on: https://pdfium-review.googlesource.com/32270
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently all of the TIFF related code is being built when support for
the codec is disabled, it just isn't being utilized. Depending on the
settings being used, this unneeded code may or may not get stripped
during linking.
This CL explicitly turns off building the TIFF codec code if support
for TIFF is turned off. It also fixes cases in the code base where tif
was being used instead of tiff.
BUG=pdfium:1080
Change-Id: If6aaa8af5160fdd5b261e63bab7d5984196efcc9
Reviewed-on: https://pdfium-review.googlesource.com/32193
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Tested by running safetynet_compare.py on this patch vs master. The
results were 0 regressions and 0 improvements. The two remaining usages
cannot be replaced because they would cause a regression.
Bug: pdfium:177
Change-Id: I43eddf4ffaac2eb063f2004d6606bc3cd6e627ac
Reviewed-on: https://pdfium-review.googlesource.com/32159
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Move the predictor code into the CCodec_FlatePredictorScanlineDecoder
sub-class.
Change-Id: I5a56ba5e051cf55e8fdd039bd38089684ed257be
Reviewed-on: https://pdfium-review.googlesource.com/31272
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Use it in more places there.
Change-Id: I477670a5946ec9033ad5f2bef0fbcddb52682066
Reviewed-on: https://pdfium-review.googlesource.com/31271
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The current implementation of the GIF codec does not handle the file
cursor moving backwards correctly. Specifically the input buffer that
the data is being read into is not invalidated, so if the entirity of
the buffer hasn't been consumed, a chunk of it will be moved to the
front before reading in more data, which is just
incorrect. Additionally, depending on the specific series of
operations, it is possible that the buffer was allocated for more
space then had been read into it and the uninitialized portion at the
end is being copied to the beginning.
The file cursor may move backwards when dealing with an animated gif
or other image with multiple frames, since all of the control data is
read in on load, and future calls specify what frame to fetch. The
code has been changed to treat the input buffer as invalid when moving
the cursor to a frame location, which will bypass any of the
problematic unused saving behaviour. A call to std::min has been added
to prevent allocation of an input buffer larger then the file size.
Additionally this CL refactors GifReadMoreData to be clearer about
what calculations are occuring, since the existing code reuses a
number of vaguely named variables, making it difficult to follow.
BUG=chromium:839348, chromium:839361
Change-Id: I2865658187bdf30bcad13ef4cac4f51a8966db11
Reviewed-on: https://pdfium-review.googlesource.com/32054
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The type is known where we need it, and we avoid some dubious
casts in the process. Also avoid clumsy indexing and use the
members directly in computations.
Bug: pdfium:243
Change-Id: I1e061465fd0f9045cf5b82067204f26ac7df53f0
Reviewed-on: https://pdfium-review.googlesource.com/31651
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ie700e132f13f2cb4851ea59b68c891e3c42af243
Reviewed-on: https://pdfium-review.googlesource.com/31531
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: If75c0db94d341715e0bc6406f0fd89812f1ea73c
Reviewed-on: https://pdfium-review.googlesource.com/31311
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ifbacab2868232a5597ef782fb24a749ebb4871bf
Reviewed-on: https://pdfium-review.googlesource.com/31270
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
- Merge Create() with the ctor.
- Initialize all member variables and mark them const when possible.
- Add an enum class for the predictor type.
- Move it into an anonymous namespace.
Change-Id: If7bb62ddf4a4e00ec2d02355e7c178028a7c187c
Reviewed-on: https://pdfium-review.googlesource.com/31233
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Applies std::remove_ptr to the public API types so that we can
deduce a correct unique ptr type no matter how that API might
change away from void* usage.
Creates shorter names for std::unique_ptr<std::remove_pointer<>, ...>
Change-Id: I04a0ff43cb7d5a4d3867939a53a54c9cef00db86
Reviewed-on: https://pdfium-review.googlesource.com/31292
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:41
Change-Id: I98070a5a6c88a0769f2b571eae4fe62092f7dfcd
Reviewed-on: https://pdfium-review.googlesource.com/31232
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
FX_Realloc() never fails. So either remove the check or switch to
FX_TryRealloc().
Change-Id: I11fd02508add50db900a7502835018c2b61bcd09
Reviewed-on: https://pdfium-review.googlesource.com/30712
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It is set in a couple of places, but the value is never used
for any purpose.
Change-Id: I6fc0839bc14b21ee8217fcb3eadf6c252ad67aa7
Reviewed-on: https://pdfium-review.googlesource.com/30330
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This might make the memory tools more effective in finding OOBs.
Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf
Reviewed-on: https://pdfium-review.googlesource.com/29550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I94412dd183535c18f4421b465f64870b44ad230d
Reviewed-on: https://pdfium-review.googlesource.com/28971
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Destination variables usually have "dest" or "dst" as the prefix.
Change-Id: If5bb01a5eafe1e4b42d1a6d653abb1b444b1b2fa
Reviewed-on: https://pdfium-review.googlesource.com/28970
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Helper functions make getting the bpp and component count more readable.
Change-Id: Ie0f97d52136d11ef5251f6e22748e87aea289ae1
Reviewed-on: https://pdfium-review.googlesource.com/28572
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL renames the 3 IFX files in core/fxcrt to Iface instead.
Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3
Reviewed-on: https://pdfium-review.googlesource.com/27970
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f
Reviewed-on: https://pdfium-review.googlesource.com/26950
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This changes the return value from uint32_t to FX_FILESIZE, which is
the type the methods is uses return. The existing code does an
unguarded static cast, so something like -1 could cause a very large
value being returned.
This change has a cascading impact up to the top of the progressive
codec, which now has to handle negative values gracefully.
Change-Id: I813fb71e932dd5da014dbaed0dbf3bb28f8d4e9f
Reviewed-on: https://pdfium-review.googlesource.com/26450
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Do some additional checks in test cases where pages were rendered but
the resulting bitmap was immediately destroyed.
Change-Id: I2f4678140cdc672ab4ced70f748135464447ff59
Reviewed-on: https://pdfium-review.googlesource.com/25510
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Add replacement methods that make themselves clear as to what they are
rendering, and return unique_ptrs to help prevent leakage. Mark existing
methods deprecated.
Change-Id: I9055407e614dfbe765428fb32a7da64df3418d1d
Reviewed-on: https://pdfium-review.googlesource.com/25470
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:808336
Change-Id: I3201805a374b5403149eca701714ef4369a2e337
Reviewed-on: https://pdfium-review.googlesource.com/25630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
BMPDecompressor -> CFX_BmpDecompressor
CBmpContext -> CFX_BmpContext
BUG=chromium:808336
Change-Id: If8ef5294171e3619ae1d7c5175ddf23b7673ec78
Reviewed-on: https://pdfium-review.googlesource.com/25611
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:808336
Change-Id: Id721787dd77d1bcac6daf6e3c149f79e8d1d9fe4
Reviewed-on: https://pdfium-review.googlesource.com/25610
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Currently there is no indication in the name of it being a member
variable and the capitalization is inconsistent. This CL brings them
all into line with Chromium style.
BUG=chromium:808336
Change-Id: Iaed0272b69350f316371a67eb513934a0169f451
Reviewed-on: https://pdfium-review.googlesource.com/25430
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Bug: chromium:802094
Change-Id: I99d2d75cd431afe1cdb966e1431143ab43dd9a73
Reviewed-on: https://pdfium-review.googlesource.com/24730
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: chromium:797726
Change-Id: Ib13d5a4a78de462f1257f1103728f2a4111cb916
Reviewed-on: https://pdfium-review.googlesource.com/24510
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:805881
Change-Id: I3b4914325833c859285a4af1f6e326872cbf1b18
Reviewed-on: https://pdfium-review.googlesource.com/24091
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:805881
Change-Id: I91266367296218998d011dd5f62e0b4c6df291a3
Reviewed-on: https://pdfium-review.googlesource.com/24070
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The guard being removed was moved lower down in the code, but it
appears the original creeped back in while I was rebasing at some
point. This is causing clusterfuzz failures.
BUG=chromium:803732,chromium:803735
Change-Id: I5bcc6046e64d6060a674f390e243dd8eda9d1d17
Reviewed-on: https://pdfium-review.googlesource.com/23250
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Refactoring the big image format switch in ContinueDecode to call
separate methods for each image format, instead of having one giant
switch block. This should have no functional changes.
BUG=pdfium:976
Change-Id: Ide4892526ee823023c233f0e43b1c98ac8bd1477
Reviewed-on: https://pdfium-review.googlesource.com/23134
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Refactoring the big image format switch in StartDecode to call
separate methods for each image format, instead of having one giant
switch block. This should have no functional changes.
BUG=pdfium:976
Change-Id: I4e609ecaec0c5d0e173957c0795555b37c38f9a2
Reviewed-on: https://pdfium-review.googlesource.com/23131
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Refactoring the big image format switch in DetectImageType to call
separate methods for each image format, instead of having one giant
switch block. This should have no functional changes.
BUG=pdfium:976
Change-Id: I52cc83879da20b33d471420016f6b1eb53993f0b
Reviewed-on: https://pdfium-review.googlesource.com/23130
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|