16103 Commits

Author SHA1 Message Date
Tom Sepez
f0dc864fb1 Put plugin-specific logic in pdfium_common_config.
Define a symbol indicating it is present, and then use it to
condition plugin-specific definitions so as to avoid breaking
(future) builds against off-the-shelf clang compilers, as
plugin-only #pragma syntax may be added.

Change-Id: Ia485f9ed56705f2bf9506c9ba868b6b4515aca52
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118273
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-10 01:01:47 +00:00
Tom Sepez
1eb7ddcf18 Apply UNSAFE_BUFFERS() to two-arg span ctor in xfa/
Follow-on from
    https://pdfium-review.googlesource.com/c/pdfium/+/118250

-- also include fxbarcode directory, since it is only used for xfa.

Change-Id: I5548bd7cffaaee12c7e30091c7bf4d58b450c535
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118271
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-09 20:19:26 +00:00
Tom Sepez
590668ba71 Apply UNSAFE_BUFFERS() to two-arg span ctor in testing/
Follow-on from
    https://pdfium-review.googlesource.com/c/pdfium/+/118250

-- Also include the samples/ directory, since it is related to testing
   in some sense.

Change-Id: I380f4f3b2e883002cf6a1a882d9a1f823f18caf7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118270
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-04-09 19:44:34 +00:00
Tom Sepez
3b679fe3f5 Apply UNSAFE_BUFFERS() to two-arg span ctor in fpdfsdk/
There isn't any reason to trust a programmer-provided length vs.
those deduced by the compiler.

-- Re-write some cases to use subspan where possible.
-- Flag the rest as UNSAFE_BUFFERS().

Change-Id: I8d2fded1c473c5320fca034e0d66b110071076a7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118250
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-09 18:49:32 +00:00
Tom Anderson
317e40e19a Use new instrumented_libs repo
This should make rolling instrumented_libs easier in the future
since hooks don't also have to be updated.

Change-Id: I3de979f251702c1421b4a426168a71002bd4ea76
Bug: 320564950
R=thestig
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118230
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-08 20:19:33 +00:00
pdfium-autoroll
0e4ff8cd88 Roll Zlib from c5bf1b566e5d to d076d8bd0898 (6 revisions)
c5bf1b566e..d076d8bd08

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/zlib-pdfium
Please CC pdfium-reviews+autoroller@googlegroups.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: pdfium-reviews+autoroller@googlegroups.com
Change-Id: I0fddf1951eadca4879f3c38c64576ccfc276c54a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118210
Commit-Queue: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2024-04-08 05:37:13 +00:00
Tom Sepez
5a49e751ea Roll build/ e5ff2eff3..e4eef53d5 (27 commits)
e5ff2eff3b..e4eef53d5b

Pick up change at 8d897a51bd1726d0dfc5a8ebbb15ee141415dbae to move GN
arg clang_unsafe_buffers_paths to BUILDCONFIG.gn.

Created with:
  roll-dep build

Change-Id: I7e6e837062e1d2fcdb7369c5a82d8782cd6a17fb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118170
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
2024-04-04 22:01:41 +00:00
Tom Sepez
059201ee50 Fix unsafe buffer usage in fxbarcode/datamatrix.
-- convert to std::array<> where indexing required.
-- use spans of chars in place of C-style pointer.

Change-Id: I41804397a4a8e4913f13e38c00bc19e6d1e4e58b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118110
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-04 22:00:13 +00:00
Tom Sepez
d3c008e60b Avoid some two-arg make_span() calls via extern spans.
Specifying an explicit length to make_span() should be treated
as an unsafe operation.

-- move arrays themselves into anonymous namespaces.

Change-Id: I9f32dd25de20784f7061618a09221e0b5b3bd611
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-04 21:52:33 +00:00
Tom Sepez
666c400d48 Fix unsafe buffer usage in (non-XFA) JS bindings.
-- convert to std::array<>, or
-- avoid indexing with range-based loop, or
-- mark two routines UNSAFE.

Change-Id: I5f2ed1819d139c82e69e89c7502ccfa931d1cdf2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118074
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-04 21:24:15 +00:00
Tom Sepez
b079e87388 Fix some unsafe usage in cpdfdsk_{helpers,interactiveform}.cpp
Change-Id: I936f9a9d750eda57c0c8c87a1d3531607bd26d90
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118075
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-04 19:04:46 +00:00
Andy Phan
c658519d73 Roll v8/ f6f7c6822..7f0739496 (162 commits)
f6f7c68229..7f0739496b

Version 12.5.130

Created with:
  roll-dep v8

Change-Id: I8c5aa587c030f78dd24f4256930a86a447637d73
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117934
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
2024-04-04 18:51:57 +00:00
Andy Phan
b756612c79 Use the new v8 interceptor API
The original v8 interceptor API has been deprecated. Update the code to
use the new API.

Change-Id: Icf5a2f2f4bd045d48c8a2143e2cdaa14964d27e0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117936
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-04-03 15:44:04 +00:00
Andy Phan
afc399ff5a Roll v8/ fe4ad3b98..f6f7c6822 (302 commits)
fe4ad3b98b..f6f7c68229

Version 12.5.35

This is a partial roll. https://crrev.com/c/5372060 causes compiler
errors for using deprecated classes.

Created with:
  roll-dep v8

Change-Id: I7ea3faaac3f758e30d4202bc2c768a5ac5e2b70b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117935
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
2024-04-03 00:41:33 +00:00
Tom Sepez
6af6c6197d Fix unsafe pointer usage in CJX_HostPseudoModel
Change-Id: I0c5b4d753ee41ba5b9bf6460f7d7eafab909b81b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118072
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-03 00:10:15 +00:00
Lei Zhang
b9ebffc36e Fix typo in {Byte,Wide}StringView.TrimmedRight tests
In ByteStringView.TrimmedRight, there exists a variable that should be
used on the next line, but is not due to a typo. Put the variable to
use. Do the same for the WideStringView version of the test.

Change-Id: If47e56271003d8cfb3e381c967e5a1a97fb3c166
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118073
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-04-02 21:32:14 +00:00
Tom Sepez
567dff87b6 Avoid unsafe indexing in EncodeURL()
-- use std::array<> where useful.
-- use pdfium::contains() to avoid indexing otherwise.

Change-Id: I7c2ba4c6f71ab6ae94822a711c322ee1658ac82c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118070
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-02 21:07:47 +00:00
Lei Zhang
7ca0110e33 Use WriteFloat() inside WriteColorToStream()
Avoid writing out color values that violate the PDF spec.

Change-Id: I1a7b52407bedfbea443a306906e32236473addbe
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117396
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-04-02 20:58:35 +00:00
Tom Sepez
f6df154e35 Fix some unsafe buffer usage in CPDF_Dest.
Change-Id: Ia7d1ebb773361c17a9fc3eee1562483c24e66fd9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118071
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-02 20:39:01 +00:00
Tom Sepez
6ddcbf24bc Mark one remaining unsafe function in core/fpdfapi/edit.
This will allow the entire directory to be included into
UNSAFE checks once the format of the paths.txt file matures.

Change-Id: Ia57ebf136e7cdf7ce73928230a223884135a80d9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117933
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-04-02 20:30:17 +00:00
Lei Zhang
2855deed06 Do not write out /Page objects that are not in the page tree
FPDFPage_Delete() may not work as expected when used in conjunction with
FPDF_SaveAsCopy(). The CPDF_Creator code that saves the PDF does not
understand the structure of the document's page tree. Therefore, it
only looks at references to determine whether to save referenced
objects, or to discard orphaned objects. This becomes a problem when
bookmarks or other objects has references to page objects, as the page
objects are not considered orphaned.

Fix this problem by augmenting the page deletion code in CPDF_Document.
After a page has been deleted, check to see if there are any references
to the page in the page tree. If it is no longer in the page tree,
replace it with an object of type null.

Since it is likely impossible to traverse the entire PDF's object tree
and correctly remove all the references to a page, use the null object
type to null out the page is the best way to effectively remove it,
while preventing references to it from dangling. Objects that become
orphaned as a result of this modification, such as the page content
stream, will be pruned by CPDF_Creator.

Bug: pdfium:2146
Change-Id: I474ff921e2239f27652f5308b56d1c1b74b51d77
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117910
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
2024-04-02 16:07:02 +00:00
Andy Phan
e4cebef61b Roll tools/rust/ 1d0018c65..eaff38a21 (6 commits)
1d0018c655..eaff38a21e

Created with:
  roll-dep tools/rust

Change-Id: I02772ab8e67122fb8d92c68e08a00522507d8d4b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118033
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
2024-04-02 01:41:54 +00:00
Andy Phan
b870f68534 Roll third_party/skia/ 32f1cb507..7338f5521 (263 commits)
https://skia.googlesource.com/skia.git/+log/32f1cb50734a..7338f5521e05

Created with:
  roll-dep third_party/skia

Change-Id: I9297ed02d9ccfd9b148e6b19edb12661f22d5e31
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118034
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-02 01:41:51 +00:00
Andy Phan
93c8137d8b Roll base/allocator/partition_allocator/ c702699cc..8a9c3373f (30 commits)
c702699cce..8a9c3373fe

Created with:
  roll-dep base/allocator/partition_allocator

Change-Id: I466767ec5e1931ebbdc980064c11c711ad65924a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118031
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-04-01 22:05:18 +00:00
Andy Phan
e707409fc7 Roll third_party/libc++abi/src/ fc6253a64..1317096ef (2 commits)
fc6253a642..1317096ef8

Created with:
  roll-dep third_party/libc++abi/src

Change-Id: I218fd701b8c206325d423af68fad6c69989d2527
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118030
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
2024-04-01 21:58:55 +00:00
Andy Phan
6123bc06a2 Roll third_party/libunwind/src/ fc505746f..419b03c0b (2 commits)
fc505746f0..419b03c0b8

Created with:
  roll-dep third_party/libunwind/src

Change-Id: I48a0127b2a20db027e05751255465a9328d0c5e9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118012
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
2024-04-01 21:57:51 +00:00
Andy Phan
77b0d2a1bf Update reclient_version to 0.134.1.2c9285b-gomaip
Change-Id: I52ec3577ead9ff968e234aa79ca0d56b1639af88
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118032
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-01 21:48:18 +00:00
Andy Phan
9dfab8917a Roll third_party/googletest/src/ e4fdb87e7..eff443c6e (7 commits)
e4fdb87e76..eff443c6ef

Created with:
  roll-dep third_party/googletest/src

Change-Id: Ie67f4e195e986bcd5ca3d194cfc6774472d5b617
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118011
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-04-01 21:25:14 +00:00
Andy Phan
bf35e11101 Roll third_party/freetype/src/ 2a790a9f4..f42ce2556 (4 commits)
2a790a9f49..f42ce25563

Created with:
  roll-dep third_party/freetype/src

Change-Id: I32ce6c2fee379830833af58313c60cf2b4e7d6bc
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/118010
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-01 20:50:28 +00:00
Lei Zhang
483e5e1f5d Change cfx_cmyk_to_srgb code to return struct FX_RGB
Use FX_RGB consistently for color representation.

Change-Id: I282232f7eb6b91816af068edd152dccd46364596
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117391
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-04-01 19:28:36 +00:00
Tom Sepez
0095eef10f Improve comments and naming in calculate_pitch.h
Change-Id: I73b557bac38ffa9097eeffb973ee676ef3371499
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117931
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-01 18:29:16 +00:00
Andy Phan
d43b6ce462 Update gn_version to 93ee9b91423c1f1f53fb5f6cba7b8eef6247a564
Change-Id: Ie675b41ce9e0c9ed06439ecfe37f1b70cf9440f3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117970
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-04-01 18:00:59 +00:00
pdfium-autoroll
8ba296abd3 Roll Depot Tools from fbb0301f1f70 to 4a9d989f52e9 (81 revisions)
fbb0301f1f..4a9d989f52

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/depot-tools-pdfium
Please CC pdfium-reviews+autoroller@googlegroups.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: pdfium-reviews+autoroller@googlegroups.com
Change-Id: I92ab955a33c0e0f4ebd9178de669969b7d0193d5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117930
Commit-Queue: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2024-04-01 16:07:58 +00:00
pdfium-autoroll
027aa4b67d Roll Code Coverage from 10ce382356ce to f459fdcdfc6c (9 revisions)
10ce382356..f459fdcdfc

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/code-coverage-pdfium
Please CC dhoss@chromium.org,pdfium-reviews+autoroller@googlegroups.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: pdfium-reviews+autoroller@googlegroups.com
Change-Id: I62075f8ddaa385a895fe6ed2f21c20d73525323c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117950
Commit-Queue: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2024-04-01 16:07:54 +00:00
Lei Zhang
d7ec4201ba Switch CPDF_MeshStream to use FX_RGB
Consistently use this struct instead of std::array.

Change-Id: I9ccfd55834bc0a118d9e6c937604be6796005522
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117817
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-03-30 05:55:59 +00:00
Lei Zhang
ffbbea8d37 Add struct FX_RGB
Add a way to represent the RGB channels, with easy access to the color
components.

Change-Id: I051482e9e60ac73d3a1b73e6eeaa8b355d6f34be
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117816
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-03-30 05:38:19 +00:00
Tom Sepez
2238fbe1b6 Add fpdfsdk/{pwl,formfiller,fpdfxfa}/ directories to unsafe buffers.
The code is already clean with respect to UNSAFE_BUFFERS.

Change-Id: I0076c7ec9210e16cc186119bb4a8f27bd68098f7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117815
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-03-30 03:03:15 +00:00
Tom Sepez
e9b7be916f Make SBThemeData::clrBtnBK a one-dimensional array.
The code only ever uses the values at [N][1].

-- convert to std::array while at it.

Change-Id: I94ace32fb6b9d936394992619e138620eaef764b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117857
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-03-30 02:51:58 +00:00
Tom Sepez
008339888a Remove FXSYS_wcstof in favor of system wcstof().
Currently, this always copies, but we can avoid this in many (not all)
cases with a subsequent CL. There is a slight difference with large
numbers, so this is a check that thing still render properly.

Change-Id: Id4c9d061ed69ca59c5fed0e31cd5feb4574c5e6f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117331
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2024-03-30 02:06:17 +00:00
Lei Zhang
e5458325d3 Add some FPDFDocEmbedderTests that delete pages and save
Exercise FPDFPage_Delete() followed by FPDF_SaveAsCopy() under a variety
of situations. Show that FPDF_SaveAsCopy() is writing out more data than
necessary.

Bug: pdfium:2146
Change-Id: Ic520acc6a86fbf9b14854e3ba4d2b1ee71fa904b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117770
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
2024-03-29 23:50:23 +00:00
Lei Zhang
fb8abcb82a Enforce checking the return value of CFX_DIBitmap::Create()
Add the nodiscard attribute to CFX_DIBitmap::Create(). Then change all
callers that did not check the return result to do so. Fail gracefully
when it obvious how to do so. Otherwise wrap the Create() call with
CHECK().

Change-Id: Ibab42b2306e8f8a93d8d87472fcec0cb3250df73
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/115412
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-03-29 23:35:29 +00:00
Tom Sepez
8111f89461 Put unsafe buffer configuration into PDFium
This CL creates a new pdfium_unsafe_buffers_paths.txt in the
top-level directory which lists which sub-directories have been
made safe against C-style pointer arithmetic.

Change-Id: Ibe3e7bc2e3e85e573119a6123c93bc70d91f0330
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117850
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-03-29 17:04:55 +00:00
Tom Sepez
fe581ab872 Roll build/ e9a12f276..e5ff2eff3 (85 commits)
Manual roll to pick up changes related to unsafe-buffers.

e9a12f2766..e5ff2eff3b

Created with:
  roll-dep build

Change-Id: I2a464f7205f34cf5870f156d95cb40e034a4fd37
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117810
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-03-28 23:54:00 +00:00
Tom Sepez
e58d4d723b Roll third_party/icu/ 1112fa6b3..d94ab131b (8 commits)
1112fa6b3b..d94ab131bc

Created with:
  roll-dep third_party/icu

Change-Id: I520663e0fe66552d1cabd7f32ad697b0f40c38f5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117812
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2024-03-28 23:35:02 +00:00
Tom Sepez
278639036a Flag remaining unsafe buffer usage in fxcrt.
-- Suppress enforcement in tests.
-- Also add one missing case in span.h

Change-Id: Ib5a52d858a67545618099bd745a0a173b4a2c2ca
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117811
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-03-28 21:53:49 +00:00
Lei Zhang
e21f71a905 Change CPDF_MeshStream::ReadColor() to return an array
Use std::array<float, 3> consistently for color representation.

Also mark some CPDF_MeshStream methods as const.

Change-Id: I0c80cd34d916615b46525d260b1b9501e638f3fa
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117390
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
2024-03-28 20:47:01 +00:00
Lei Zhang
1f9ae706c7 Fix undefined behavior in DrawGouraud()
Use pdfium::ClampSub() to avoid undefined behavior in some DrawGouraud()
calculations. The exact result is not critical, as it only affects pixel
values.

Bug: chromium:40813106
Change-Id: I7eaecb1f64fa1c4f46c051280337f0d414a582f0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117730
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2024-03-28 18:43:16 +00:00
Lei Zhang
d9a0209550 Fix some nits in DrawGouraud()
- Mark some references as const-ref.
- Consolidate repeated calculations.

Change-Id: I459f3602dce352deaf9d61e667967ce0446a98cd
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117710
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
2024-03-28 18:43:09 +00:00
pdfium-autoroll
1c2507320e Roll Catapult from 4dc7721a1444 to 949df6114f3f (83 revisions)
https://chromium.googlesource.com/catapult.git/+log/4dc7721a1444..949df6114f3f

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/catapult-pdfium
Please CC dhoss@chromium.org,pdfium-reviews+autoroller@googlegroups.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: pdfium-reviews+autoroller@googlegroups.com
Change-Id: I9aa877c5e84ba13a63cd67142aed6d79fda691e7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117751
Bot-Commit: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2024-03-25 05:51:01 +00:00
pdfium-autoroll
ec275ee3e5 Roll libpng from 3c7486b231c7 to 5140e80f1841 (1 revision)
3c7486b231..5140e80f18

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/libpng-pdfium
Please CC pdfium-reviews+autoroller@googlegroups.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: pdfium-reviews+autoroller@googlegroups.com
Change-Id: I762e8e5ef5870cfdf7fc996019e8440634bfd742
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117750
Bot-Commit: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: pdfium-autoroll <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2024-03-25 05:46:13 +00:00