Age | Commit message (Collapse) | Author |
|
Due to some of the size parameters for allocating space in Decode()
depending on the values produced by opj_decode(), this change was
causing misallocation of space, which in turn was causing illegal
reads/writes.
The issue with excessive memory usage that the original CL was trying
to change is less significant than the above mentioned problems, so
reverting this fix and looking for another solution to the
problem. This will re-open bugs https://crbug.com/754423 and
https://crbug.com/761005.
BUG=chromium:764177,chromium:754423,chromium:761005
Change-Id: I1cafac8a8117ec1e3bc32b31196bdec719d46477
Reviewed-on: https://pdfium-review.googlesource.com/13950
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL changes the behavior of FPDF_RenderPageBitmapWithMatrix so it
transforms the bitmap. Before, the page would be transformed and the
assumption was that it would be drawn on a bitmap with the same
dimensions as the original page. This does not work well because a
transformation generally changes the dimensions of the page. The
rectangles test is modified to include small rectangles in the corner
of the page, so that it's clear that the whole original page is being
displayed.
Bug: pdfium:849
Change-Id: Ie89f959a1605fea59a15d239ca871ccd939ec92b
Reviewed-on: https://pdfium-review.googlesource.com/13510
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Reverse iteration with signed lengths and indices is kinda icky
without this abstraction, and STL provides this pretty much "for
free" given the existing forward iterator.
Change-Id: I97c36c8bd23c0aa48195bc17da7c672292b4cde2
Reviewed-on: https://pdfium-review.googlesource.com/13770
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I2a750c8e46b68dc4870e2dadd2ed3429008e1562
Reviewed-on: https://pdfium-review.googlesource.com/13551
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The existing code did end of range checks by making sure that the
value was never less then 0. This isn't correct when using an unsigned
type, since 0 - 1 will wrap around to the max possible value, and
thus still be less then 0. Additionally the existing code was hard to
follow due to the complexity of some of the low level operations being
performed.
It has been rewritten using higher level string operations to make it
clearer and correct.
BUG=chromium:763256
Change-Id: Ib8bf5ca0e29e73724c4a1c4781362e8a8fc30149
Reviewed-on: https://pdfium-review.googlesource.com/13690
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Speculative fix for bug. Also remove FX_VA_COPY as va_copy should
be fine on all ports nowdays (we think).
Bug: 763965
Change-Id: I5c321d5624d00b3b2f262ec599e4382f02b744ff
Reviewed-on: https://pdfium-review.googlesource.com/13790
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
When reading a stream, if it is encrypted using an AES cipher it must
be atleast 16 bytes long aka 128 bits, other wise it is malformed.
BUG=chromium:763585
Change-Id: Ied7c36978f1eb24aeda93a184527b6d6a191e5c3
Reviewed-on: https://pdfium-review.googlesource.com/13751
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:761005
Change-Id: I538e49f1eeb32891b33677d8587d2bed110b1fc1
Reviewed-on: https://pdfium-review.googlesource.com/13692
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This patch was authored by Ke Liu of Tencent's Xuanwu Lab.
BUG=762374
Change-Id: Icb3ee98fb4c399b871ccf11e9920af7caf51be11
Reviewed-on: https://pdfium-review.googlesource.com/13610
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
|
|
BUG=chromium:762106
Change-Id: I714d69320cc4fb81d535f811c18d4ef91fec44d3
Reviewed-on: https://pdfium-review.googlesource.com/13212
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Take seed generation logic from base's address_space_randomization.cc.
One small tweak is to avoid the bottom three bits of a stack address and
invert, to make leaking ASLR more difficult along the lines of the
freelist masking in base's partition allocator. Another tweak is to
mix in some more time-based information. Another tweak is to add in
the times called so that rapid successive calls return different results.
Bug: pdfium:891
Change-Id: I14238da15cee9c8d4ca72d79e4f7fbb26997c619
Reviewed-on: https://pdfium-review.googlesource.com/13490
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
In the existing implementation of the JPX decoder, Init extracts the
header from the image and then immediately decompresses it. This is
problematic if it is a very large image that we won't be able to
allocate a bitmap for. The code has been changed to instead delay
decompression until the Decode method, since things like dest Bitmap
generation can be performed using just the header information.
There is also a bit of renaming/casting cleanup, because I was having
a hard time parsing what was a local vs member variable.
BUG=chromium:761005
Change-Id: I55a55c0be2f88a5352a6ca056c2a816137d7c749
Reviewed-on: https://pdfium-review.googlesource.com/13550
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
R=dsinclair@chromium.org
Bug:
Change-Id: I34f9498f4e5942c5b10ab2848509de935882321d
Reviewed-on: https://pdfium-review.googlesource.com/13470
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I92c0bd417d9c5be59c36401efae89406e482756a
Reviewed-on: https://pdfium-review.googlesource.com/12650
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use CPDF_SyntaxParser::ToNextWord to move position on word start.
Change-Id: I6b63efc9027b2a4eb4749561bf8ce2b95527d03b
Reviewed-on: https://pdfium-review.googlesource.com/12830
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This enables MSVC by default on Windows again, so fix code that fail
to build with MSVC too.
Change-Id: I03fb4e3697ad777a4dca88af462b35526d6c1d4d
Reviewed-on: https://pdfium-review.googlesource.com/13392
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:828
Change-Id: Ifeaf19291ffd33aab63449ab52f8d2606b66c0fc
Reviewed-on: https://pdfium-review.googlesource.com/13330
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
DEPS roll is failing since std::min(size_t, int) -> int doesn't make
sense. min is templated on a single class, i.e. std::min(size_t,
size_t) -> size_t.
BUG=pdfium:828
Change-Id: Idec3ac7bdbf1d22b8c878a95bd9c44c9a94bbccf
Reviewed-on: https://pdfium-review.googlesource.com/13310
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL moves the CFX_WordBreak::FindNextBreakPos into the text edit
engine iterator. The word break data was moved to cfde_wordbreak_data.
Change-Id: Ie022f5f761479f97b9d4bc7789f890cb2ef99106
Reviewed-on: https://pdfium-review.googlesource.com/13250
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL implements the needed logic in CFDE_TextEditEngine to handle
word selection.
Change-Id: I6b388c23655037fec107d68ec07d33638b959374
Reviewed-on: https://pdfium-review.googlesource.com/13211
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change the underlying type for FX_STRSIZE to size_t from int. This
will make the value unsigned and thus all values in the range of the
type will be valid. This allows for the final remove of negative
length strings, but also introduces a some casting and functional
errors, since many parts of the code base assume that FX_STRSIZE is
int or another signed type. This also CL fixes these errors.
BUG=pdfium:828
Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b
Reviewed-on: https://pdfium-review.googlesource.com/11830
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes fx_guid and inlines into CXFA_FM2JSContext as needed.
Change-Id: I08a1f03fd4be46730eee24ab73b8b5c0daf9cd7d
Reviewed-on: https://pdfium-review.googlesource.com/13094
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
CFX_WordBreak::Next is never called, removed. This was the only method
to pass a different value for the bFromNext param for FindNextBreakPos()
so that param was also removed.
Change-Id: I14ca0dc65490ec64209ba0b872794f75b3e3104f
Reviewed-on: https://pdfium-review.googlesource.com/13210
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Match FX_Random method names.
Change-Id: I2d178229563881479b80e1f86975f5b165475837
Reviewed-on: https://pdfium-review.googlesource.com/13093
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Remove unused GetWord, make methods only used in the class private.
Change-Id: Ia5b63da7f9dc3a918380742213d98f9d1b3651a3
Reviewed-on: https://pdfium-review.googlesource.com/13092
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Do not check recursive parsing of same object in CPDF_SyntaxParser,
because this problem is solved in CPDF_IndirectObjectHolder.
(See https://pdfium-review.googlesource.com/c/pdfium/+/12590)
Change-Id: I7829e06ae5eb06e85a0c8cfe22c1c428b55bb692
Reviewed-on: https://pdfium-review.googlesource.com/12610
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The CFX_CharIter class was only used in a single Attach call of
CFX_WordBreak which is never called. Removed.
Change-Id: I8262cbb25d341b976ab85095250357fecba48fbc
Reviewed-on: https://pdfium-review.googlesource.com/13091
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL splits the GUID code out of fx_extension into an fx_guid.h file.
Change-Id: I915538ff98601efb07595264eff6435729193177
Reviewed-on: https://pdfium-review.googlesource.com/13090
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the code invovled in random number generation into
fx_rand.h from fx_extension.h.
Change-Id: I6c644d7ec0323f32ef6e23c2e2548a9c792e3a72
Reviewed-on: https://pdfium-review.googlesource.com/13070
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CPDF_stream constructors were not setting the "Length" into the stream dictionary.
The "Length" was being set by the SetData methods.
This CL fixes the constructor to properly set the "Length" field.
Change-Id: Iee1bd7f7a096d415ab01ee3d2f3416e19e87ece9
Reviewed-on: https://pdfium-review.googlesource.com/13010
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
CPDF_IndirectObjectHolder is optimized.
Recursively parsing of same object has been fixed.
Change-Id: I22e5cfd6b03eee0677f2b1f8ba32bf29cad441fc
Reviewed-on: https://pdfium-review.googlesource.com/12590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Change-Id: I5473d6db3e6fc247d52a83b34424958dc20387f4
Reviewed-on: https://pdfium-review.googlesource.com/12150
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
File naming now matches.
Fix one usage not going through the accessor function.
Change-Id: I5cc4986238764964f2a71807a94bd2facf517263
Reviewed-on: https://pdfium-review.googlesource.com/12930
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Mid(foo, 1) is equivalent to [foo], if all you want is the character. Similarly
Left(1) is [0]. It is faster also, since it does not need to create intermediate
strings.
Right(1) is a touch more tricky, since it requires something like GetLength() ?
[GetLength() - 1] : 0;. A new method, Last() has been added to perform this
character extraction.
Multiple call sites have been updated to use more efficient/simpler
syntax. There are a number of call sites that use on these patterns, but based
on the surrounding context we actually need/want a string, so they have not been
modified.
Change-Id: I485a7f9c7b34c9bdacecada610158f996816afdd
Reviewed-on: https://pdfium-review.googlesource.com/12890
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
When turning on this conversion a number of typing issues and other nits where
found in the code base that can be merged in without actually changing the
underlying type. Landing these changes before the type change CL, since there is
a high likelihood that the type change will need to be rolled back, since it is
high risk.
BUG=pdfium:828
Change-Id: I587443d9090055963446485a1aacb8772eb5ca64
Reviewed-on: https://pdfium-review.googlesource.com/12810
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: chromium:760034
Change-Id: Id0862749b1454e065de4de7d746a27e78ac58e30
Reviewed-on: https://pdfium-review.googlesource.com/12730
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Adjust loop conditions and behaviours in preperation for convering the
underlying type of FX_STRSIZE to size_t. These changes are not
dependent on the type switch occuring, so can be landed before hand.
BUG=pdfium:828
Change-Id: I5f950c99c10e5ef0836959e3b1dd2e09f8f5afc0
Reviewed-on: https://pdfium-review.googlesource.com/12750
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I13140ea4242db4b0860f8fdd164f50d1745c0794
Reviewed-on: https://pdfium-review.googlesource.com/12790
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The CFXCRT and IFXCRT prefix was only used on 3 files. This CL renames
them to the more common CFX and IFX. The files were renamed as needed.
Change-Id: Iccdaa55c5822adb93af7c58aedfb121413a30223
Reviewed-on: https://pdfium-review.googlesource.com/12675
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves code defined in fx_system.h to be implemented in
fx_system.cpp.
Change-Id: I0c19066d4497bd208f4560fdcaf57cf04bf9f146
Reviewed-on: https://pdfium-review.googlesource.com/12674
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the GetBits32 implemenation into fx_extension.cpp. It
also moves some of the fx_basic unittests to the correct unittest files.
Change-Id: I2cf8657c228375508db0f02baa628d62a3b2ab25
Reviewed-on: https://pdfium-review.googlesource.com/12673
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves methods defined in fx_stream.h into the fx_stream.cpp
file.
Change-Id: I32147d18dd7f4a29c228f11d108ac01cb891b290
Reviewed-on: https://pdfium-review.googlesource.com/12672
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I6a588b4af4cfede922bc3756be749e9e30e3e8e5
Reviewed-on: https://pdfium-review.googlesource.com/12370
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This CL creates an fx_string.cpp and moves any methods defined in
fx_string.h into the .cpp file.
Change-Id: I64c310b9be6d8f4c3be633a22884023c0b16fc1b
Reviewed-on: https://pdfium-review.googlesource.com/12671
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
For example, Indexed colorspace A uses ICC Based colorspace B as its
"base". B declares A as its "Alternate" fallback.
Bug: chromium:759012
Change-Id: I4b78e68b9a77456050ecae4452837495546bf93d
Reviewed-on: https://pdfium-review.googlesource.com/12471
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Remove dead code, move code to namespaces where possible, cleanup some
single use items.
Change-Id: Ia734477ceb2105a1ed272463bd8220f1205a7ce9
Reviewed-on: https://pdfium-review.googlesource.com/12732
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I6df7e7d1283541ea2e6b9bcf3de172f6a886054a
Reviewed-on: https://pdfium-review.googlesource.com/12731
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the BIDI code from fx_arabic to fx_bidi and conditionally
compiles based on XFA.
Change-Id: Iaba60486f03e48f0816d60e365a58a8622bc8254
Reviewed-on: https://pdfium-review.googlesource.com/12713
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:875
Change-Id: I3cc29990f0a3398ae903bc14417ec695cca30c6c
Reviewed-on: https://pdfium-review.googlesource.com/12391
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Wei Li <weili@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|