Age | Commit message (Collapse) | Author |
|
Re-order some locals to obey strict lifetime constraint.
Pack a little tighter.
Change-Id: Iae011d21b934fac865cf10ac20c046c8917d3a98
Reviewed-on: https://pdfium-review.googlesource.com/40915
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Pack a little tighter while at it.
Change-Id: If7cbb324ebf828a4bb60eb364fc3e0f31625e57f
Reviewed-on: https://pdfium-review.googlesource.com/40913
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ie3502443b801ae4af6e4c9e533f28d102703104c
Reviewed-on: https://pdfium-review.googlesource.com/40912
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
First real use case of assigning Unowned to MaybeOwned.
Change-Id: Ia5bc7102012f7a09120ba02d38cf751547d5c005
Reviewed-on: https://pdfium-review.googlesource.com/40914
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I662f65b53a1a17be0062c92452d82acbbe157477
Reviewed-on: https://pdfium-review.googlesource.com/40910
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bug: 876222
Change-Id: I56c20c006ee26650f32b9ec90f3c7f91466b7470
Reviewed-on: https://pdfium-review.googlesource.com/40890
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Pack a little tighter while we're at it.
Change-Id: I8cbefe5df1b4340cb55ea14a5ae00ebc1ad07114
Reviewed-on: https://pdfium-review.googlesource.com/40774
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
When trying to sanity check SBNUMINSTANCES for JBIG2 text regions for
https://crbug.com/837192, the check did not take data encoding into
account. Fix this by assuming there is a potential for 16:1 compression
in the lossless encoding.
BUG=chromium:871848
Change-Id: I991dacff9fbefa4e302f5ce92a355902ef94308a
Reviewed-on: https://pdfium-review.googlesource.com/39790
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Once upon a time, someone cut-n-pasted ~300 lines of code to avoid
creating a default rectangle and to save a couple of additions. Then
one path got one set of fixes (safe ints) and the other path got a
second set of fixes (source bounds checks). Re-unify, picking up all
the fixes, since they are identical otherwise.
Change-Id: I099e854bc8ad027efabd5c2077c4319ee8221256
Reviewed-on: https://pdfium-review.googlesource.com/39550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
We can use the memcpy() path whenever byte aligned.
Split code into helper methods.
Add test for fast path specifically.
Change-Id: I52f6129b0e788eb2da60536cfa6fce12a0609375
Reviewed-on: https://pdfium-review.googlesource.com/39432
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bundling the test with the accessor is a safer pattern than
performing the check externally.
Add test for CopyLine().
Change-Id: I7056bf33bdca40cb84a89e4928567a389d88ff1c
Reviewed-on: https://pdfium-review.googlesource.com/39431
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Add checked/unchecked GetLine(y) methods and use them.
Introduce BIT_INDEX_TO_ALIGNED_BYTE() to de-mystify some shifting.
Move local declarations to spot of use.
Remove spurious Fill(), as we initialize to 0s.
Initialize members in header where possible.
Add unit tests.
Change-Id: I41ccb91b57320dbc790fd0f680f6d98571280343
Reviewed-on: https://pdfium-review.googlesource.com/39370
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Provide symmetry with JBIG2_GETDWORD().
Avoid potential illegal undefined signed shift in JBIG2_GETDWORD().
Get better column alignment under cl-format via pointless shift by
zeros for consistency.
Change-Id: I13d46fe7976074e26df72b58a055788390191364
Reviewed-on: https://pdfium-review.googlesource.com/39430
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
No matter how the dimensions might be determined, we know the
hard end of the source line, and can use it for a bounds check.
We expect the size is quantized to a multiple of m_stride, so
as long as each block operates within an m_stride, the initial
check should be sufficient.
Bug: 867501
Change-Id: Iaf9936557b856f3eb09fef522f3e6738aa4f38f0
Reviewed-on: https://pdfium-review.googlesource.com/39310
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL merges DecodeArithTemplateXUnopt for X=0,1,2. This is similar to
how three methods were merged into DecodeArithOpt3.
Change-Id: Ib0d4f14de6a8c924517d82eaec7577961503a325
Reviewed-on: https://pdfium-review.googlesource.com/38935
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Commit 7695dd0f mistakenly changed a signed integer to unsigned. This is
incorrect because right shifts for negative integers behave differently.
BUG=chromium:859284
Change-Id: Id9c54848b15ace1de080c174f261dd2c064018e0
Reviewed-on: https://pdfium-review.googlesource.com/37230
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:859284
Change-Id: I41ce5de4cca0a863dc6e60b64fd69d36c2672a64
Reviewed-on: https://pdfium-review.googlesource.com/36790
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CJBig2_PDDProc internally creates a CJBig2_GRDProc to create an image.
If the image is too big, then processing it can use up too much memory.
BUG=chromium:857106
Change-Id: I06a9eaed6941be1cbb7481d21048e6a1681696b7
Reviewed-on: https://pdfium-review.googlesource.com/36490
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ia83ac5dae0dedf55f1b0f0cf2a728c64474f72db
Reviewed-on: https://pdfium-review.googlesource.com/36450
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL merges 3 methods into a single DecodeArithOpt3(). The code is
the same, except for some constants which are extracted out as namespace
variables.
Change-Id: I6d9127d71b5e7c4c75e31a736b0f3307bb78a076
Reviewed-on: https://pdfium-review.googlesource.com/35170
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL changes GetHuffmanTable() to return a const pointer and fixes
other members / functions accordingly.
Change-Id: Ie62fe044b3156f67885dd4fa1f6512cbd35a83d3
Reviewed-on: https://pdfium-review.googlesource.com/35116
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This CL cleans up variables in CJBig2_Context. It moves some
declarations further, to when the variables are actually used. It also
caches huffman tables in a vector of unique_ptr.
Change-Id: Id3af96f9526b1000f681e4e2b174bba07b45ee55
Reviewed-on: https://pdfium-review.googlesource.com/32715
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Just use memcpy() and memset().
Change-Id: Id6c6fab4e65a5524786ae318270c5981313825f2
Reviewed-on: https://pdfium-review.googlesource.com/32743
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Nobody reads it.
Change-Id: I76c0f5881e5432d2086cb8eaec7fc70fa5b71536
Reviewed-on: https://pdfium-review.googlesource.com/32741
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Rename fooBar() to FooBar().
Change-Id: I87775fa14ce7e4f4a5897780d0d02fb61c7693ff
Reviewed-on: https://pdfium-review.googlesource.com/32739
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
CJBig2_Image::ComposeFrom() wraps a call to ComposeTo() and does an
extra validity check. In tight loops where the validity check will
always succeed, this is wasteful. Change existing callers of
ComposeFrom() to ComposeTo() when the validity check has already been
done.
BUG=chromium:840728
Change-Id: I39fb42eea49b92b7804cbd42c3d8a0329edeb58d
Reviewed-on: https://pdfium-review.googlesource.com/32637
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ib44a6b7bd19625a4081322d2471551bec894abd8
Reviewed-on: https://pdfium-review.googlesource.com/32638
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL changes the table information so it can be indexed, and allows
moving all of the information to the CJBig2_HuffmanTable implementation,
which is the only real user of the data.
Change-Id: I88780bee32c8509198518fd3b1e82d68ae7ff707
Reviewed-on: https://pdfium-review.googlesource.com/32635
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This CL merges some of the values of JBig2_Result. The only checks are
against Success and EndOfFile || EndOfPage, so we only need three
values: Success, EndReached, and Failure (for anything that does not
match either of those two).
Change-Id: I552c54f2d70aa8e8bf52702dab4dfc00d528ef76
Reviewed-on: https://pdfium-review.googlesource.com/32393
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
https://pdfium-review.googlesource.com/c/pdfium/+/18333 introduced
several checks to prevent timeouts in JBig2. One of these is breaking
the PDF in the bug, so this CL removes that check.
Bug: chromium:841200
Change-Id: Ia75c699b7fddc26f0353b0d64349898c4d1f744d
Reviewed-on: https://pdfium-review.googlesource.com/32250
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@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>
|
|
Instead of allocating an N-pixel array to store some temporary values,
just use a single integer.
BUG=chromium:840728
Change-Id: I7a0ff83d814eff127033f25020a7c398db3c2062
Reviewed-on: https://pdfium-review.googlesource.com/32290
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Skip a lot of work that will all fail anyway.
BUG=chromium:838347
Change-Id: Iba45120e436b5547e106feb27dadea92cc948258
Reviewed-on: https://pdfium-review.googlesource.com/32053
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:837972
Change-Id: I6cfa28bff38870419e4b1e2bced427cfcbf843cd
Reviewed-on: https://pdfium-review.googlesource.com/31912
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Track the decode state in one data structure. Also grab pointers to data
structure members before tight loops when decoding. It turns out
referring to this->foo in tight loops can actually slow down decoding.
Change-Id: I6a09b08ca06ef05968966055b5ad20f8c89896af
Reviewed-on: https://pdfium-review.googlesource.com/31790
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
- Mark them private when possible.
- Disambiguate method names.
- Make method names match the style guide.
- Pass in rects by reference.
Change-Id: I0bf848756e81a92d20e46a81cd6260b660eaf482
Reviewed-on: https://pdfium-review.googlesource.com/31772
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Use CJBig2_Context::HuffmanAssignCode() instead.
Change-Id: Ief187420494a8cefa26eeedb98a55683caf7807b
Reviewed-on: https://pdfium-review.googlesource.com/31538
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I6461f81a3d8005efa75b8141c18c502a63252883
Reviewed-on: https://pdfium-review.googlesource.com/31537
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
It looks a lot like CJBig2_HuffmanTable::InitCodes(). Port over the
UBSAN error fix from commit 76c9a1b1.
BUG=chromium:709781
Change-Id: I5d2f8fb013c09099c82b0565627b77e4fb0f8a98
Reviewed-on: https://pdfium-review.googlesource.com/31536
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
One of its parameters is a member variable.
Change-Id: I0dcb78275d9ea5b05a77e211d178a0efb8699395
Reviewed-on: https://pdfium-review.googlesource.com/31535
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Pick from a set of functions before calling it, instead of having code
to call all of the functions with the same parameters.
Change-Id: I7f479948f50bdc1a9eb2764d5eb7505dc7434418
Reviewed-on: https://pdfium-review.googlesource.com/31533
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Also remove method parameters that always refer to the same member
variables.
Change-Id: I9751d63895cc59e5280283795e39b50fd42eef94
Reviewed-on: https://pdfium-review.googlesource.com/31532
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
It only looks for a single segment type.
Change-Id: I83457c6f74c210299caec79a563e7876f4d1d9ea
Reviewed-on: https://pdfium-review.googlesource.com/31534
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@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: Ic2acd6f03b9b2e52b3d94d7579d5dc36c8e62c96
Reviewed-on: https://pdfium-review.googlesource.com/31530
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:836872
Change-Id: I0362fd7708043648bffa26c9248b401ea2793a21
Reviewed-on: https://pdfium-review.googlesource.com/31510
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:837192
Change-Id: Ib9c0e7b4aeb6501e81308844d344a784f7c138d8
Reviewed-on: https://pdfium-review.googlesource.com/31490
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
BUG=chromium:834557
Change-Id: I8fb8d74f87097b39608c3f83f2fa1c4e49e69980
Reviewed-on: https://pdfium-review.googlesource.com/31170
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@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: Ic1260417e7d1475dd518655b2ab08f0184955d88
Reviewed-on: https://pdfium-review.googlesource.com/27170
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|