pdfium.git
4 years agoMerge to XFA: Cache the CPDF_Annot's subtype, since it should never changes.
Lei Zhang [Wed, 10 Jun 2015 21:51:39 +0000]
Merge to XFA: Cache the CPDF_Annot's subtype, since it should never changes.

BUG=495300
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1178513002.

(cherry picked from commit 7b2897c47245f04c806cfa8cee09458e31ba3777)

Review URL: https://codereview.chromium.org/1177003002.

4 years agoMerge to XFA: Remove typdefs for pointer types in fx_system.h.
Tom Sepez [Wed, 10 Jun 2015 21:33:37 +0000]
Merge to XFA: Remove typdefs for pointer types in fx_system.h.

Original Review URL: https://codereview.chromium.org/1171733003

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1178613002.

4 years agoMerge to XFA: Use stdint.h types throughout PDFium.
Tom Sepez [Tue, 9 Jun 2015 20:24:12 +0000]
Merge to XFA: Use stdint.h types throughout PDFium.

Near-automatic merge, plus re-running scripts to update
additional usage.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1172793002

4 years agoMerge to XFA: Remove more cruft from fx_system.h
Tom Sepez [Tue, 9 Jun 2015 18:29:12 +0000]
Merge to XFA: Remove more cruft from fx_system.h

New manual edits in the following to fix compilation:
  fx_bmp.h, fx_gif.h, fx_graphics.h

Original Review URL: https://codereview.chromium.org/1169963003

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1170103004

4 years agoMerge to XFA: Fix potentially massive memory leak in CPDF_DIBSource::LoadJpxBitmap().
Lei Zhang [Mon, 8 Jun 2015 20:59:58 +0000]
Merge to XFA: Fix potentially massive memory leak in CPDF_DIBSource::LoadJpxBitmap().

Leaks can happen in several places. For this particular bug, it happens
when there is a colorspace component count mismatch.

BUG=497191
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1153633009

(cherry picked from commit 2a824f1c0ed786aed0dd15a0ea60dc90999e2b2c)

Review URL: https://codereview.chromium.org/1168833002

4 years agoMerge to XFA: Cleanup: Make CPDF_Annot::m_pAnnotDict private.
Lei Zhang [Fri, 5 Jun 2015 22:50:32 +0000]
Merge to XFA: Cleanup: Make CPDF_Annot::m_pAnnotDict private.

Remove dead code in CPDF_Annot as well.

R=tsepez@chromium.org
TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1157773012

(cherry picked from commit b7eb193dcec1594952cbc1dca356a40f66724159)

Review URL: https://codereview.chromium.org/1157323005

4 years agoMerge to XFA: Add move constructor for FX string types.
Tom Sepez [Fri, 5 Jun 2015 22:33:03 +0000]
Merge to XFA: Add move constructor for FX string types.

Original Review URL: https://codereview.chromium.org/1162203007

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1154023005

4 years agoMerge to XFA: Standalone checkout gets buildtools.
Tom Sepez [Fri, 5 Jun 2015 20:46:08 +0000]
Merge to XFA: Standalone checkout gets buildtools.

Original Review URL: https://codereview.chromium.org/1149623011
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1152523007

4 years agoMerge to XFA: Fix bad include path in fpdfview.cpp
Tom Sepez [Fri, 5 Jun 2015 20:32:52 +0000]
Merge to XFA: Fix bad include path in fpdfview.cpp

Also sort includes missing from previous patch (some xfa IWYU
prevents full sorting).

Original Review URL: https://codereview.chromium.org/1149213008
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1157103009

4 years agoMerge to XFA: Move fx_safe_types.h to include/ directory.
Tom Sepez [Fri, 5 Jun 2015 02:05:21 +0000]
Merge to XFA: Move fx_safe_types.h to include/ directory.

Original Review URL: https://codereview.chromium.org/1147353006
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1152693005

4 years agoMerge to XFA: Kill unused IPDF_ classes.
Tom Sepez [Wed, 3 Jun 2015 23:19:04 +0000]
Merge to XFA: Kill unused IPDF_ classes.

Original Review URL: https://codereview.chromium.org/1168503003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1153033009

4 years agoMerge to XFA: Fix fx_basic_memmgr_unittest.cpp under stricter GN rules
Tom Sepez [Wed, 3 Jun 2015 19:23:31 +0000]
Merge to XFA: Fix fx_basic_memmgr_unittest.cpp under stricter GN rules

Original Review URL: https://codereview.chromium.org/1165863003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1163113002

4 years agoMerge to XFA: Automated test case for 487928.
Tom Sepez [Wed, 3 Jun 2015 00:11:18 +0000]
Merge to XFA: Automated test case for 487928.
Original Review URL: https://codereview.chromium.org/1153213004

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1158483004

4 years agoMerge to XFA: kill IPDF_DocParser().
Tom Sepez [Tue, 2 Jun 2015 21:29:00 +0000]
Merge to XFA: kill IPDF_DocParser().

Original Review URL: https://codereview.chromium.org/1158053003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1156203004

4 years agoReplace XFA_HWIDGET with IXFA_Widget*
Tom Sepez [Tue, 2 Jun 2015 17:35:27 +0000]
Replace XFA_HWIDGET with IXFA_Widget*

A second case of casting willy-nilly between unrelated structures
to provide information hiding.  Bad Idea.  Remove dozens of casts
in the process.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1155273002

4 years agoGet test running scripts to detect and report common error, XFA.
Bruce Dawson [Mon, 1 Jun 2015 21:53:02 +0000]
Get test running scripts to detect and report common error, XFA.

testing/tools/run_corpus_tests.py assumes a debug build and will
fail cryptically if only a release build is available.

Arguably there shouldn't be a default because having one could lead
to accidentally running a stale version, but that is probably too
much of a change.

TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1150823003

Review URL: https://codereview.chromium.org/1158883005

4 years agoAdd missing comma to third_party.gyp, integrated to XFA
Bruce Dawson [Mon, 1 Jun 2015 21:48:49 +0000]
Add missing comma to third_party.gyp, integrated to XFA

Original change by bungeman@chromium.org

A reference to nonstd_unique_ptr.h was added with
https://codereview.chromium.org/1091283002 but a comma is missing
after it. This causes this string to be concatenated with the next,
leading to broken sources. This went unnoticed by the build due to
the fact that the affected sources are both headers, but they should
be properly separated.

TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1156663006

Review URL: https://codereview.chromium.org/1156483006

4 years agoMerge to XFA: Fix ALL the include guards.
Tom Sepez [Thu, 28 May 2015 20:23:12 +0000]
Merge to XFA: Fix ALL the include guards.

Original Review URL: https://codereview.chromium.org/1160443004
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1162013003

4 years agoReplace XFA_HDOC with IXFA_Doc*
Tom Sepez [Wed, 27 May 2015 23:36:35 +0000]
Replace XFA_HDOC with IXFA_Doc*

There are better ways to provide information hiding than casting
willy-nilly from an unrelated structure.  Kill dozens of casts in
the process.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1146153005

4 years agoMerge to XFA: Remove rendundant ../include from paths.
Tom Sepez [Wed, 27 May 2015 23:24:18 +0000]
Merge to XFA: Remove rendundant ../include from paths.

Original Review URL: https://codereview.chromium.org/1162453003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1154613005

4 years agoMake CPDFXFA_App / IXFA_AppProvider saner
Tom Sepez [Wed, 27 May 2015 19:25:00 +0000]
Make CPDFXFA_App / IXFA_AppProvider saner

Move interface comments from the implementation header to the
interface header.

Replace Create / Release functions with static methods.

Replace dubious Release() methods with deletion via virtual dtor, also
for IXFA_App and IXFA_FontMgr while we're at it.

Untabify and fix (theoretically) illegal _CAP include guard definitions
for fpdfxfa/ headers.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1153553003

4 years agoMerge to XFA: Upgrade openjpeg to r3002
JUN FANG [Tue, 26 May 2015 19:14:39 +0000]
Merge to XFA: Upgrade openjpeg to r3002

BUG=459215
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1160663002

4 years agoMerge to XFA: Update copy of safe_math_impl.h to take a fix from upstream.
Tom Sepez [Thu, 21 May 2015 22:17:40 +0000]
Merge to XFA: Update copy of safe_math_impl.h to take a fix from upstream.

Original Review URL: https://codereview.chromium.org/1126243007
BUG=488302
TBR=eroman@chromium.org

Review URL: https://codereview.chromium.org/1153543003

4 years agoMerge to XFA: Fix four annoying warnings.
Tom Sepez [Thu, 21 May 2015 22:06:16 +0000]
Merge to XFA: Fix four annoying warnings.

Original Review URL: https://codereview.chromium.org/1148353002

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1150103002

4 years agoMerge to XFA: Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBuffer
JUN FANG [Thu, 21 May 2015 16:56:11 +0000]
Merge to XFA: Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBuffer

This issue is trigged by the conversion from unsigned int to signed int.
A large unsigned int is converted to int. It's represented as a negative
int which is used in the condition of while later.

BUG=482639
R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1146913003

4 years agoMerge to XFA: Integer overflow in CJBig2_Image::expand
JUN FANG [Wed, 20 May 2015 19:25:56 +0000]
Merge to XFA: Integer overflow in CJBig2_Image::expand

1. New size should be larger than old size in JBig2_Realloc.
2. Arguments are integers but parameters are size_t in JBIG2_memset.
   After integer overflows, it will be presented as a huge
   unsigned number on 64 bits system.

BUG=483981
R=brucedawson@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1148643002

4 years agoMerge to XFA: Tidy public fpdfview.h and fpdf_flatten.h.
Tom Sepez [Wed, 20 May 2015 17:20:35 +0000]
Merge to XFA: Tidy public fpdfview.h and fpdf_flatten.h.

Original Review URL: https://codereview.chromium.org/1139993003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1144973004

4 years agoMerge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.
Tom Sepez [Wed, 20 May 2015 16:50:37 +0000]
Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.

Original Review URL: https://codereview.chromium.org/1142713005

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1143663008

4 years agoFix compilation on xfa branch and turn on v8 deprecation warnings
Jochen Eisinger [Wed, 20 May 2015 08:49:45 +0000]
Fix compilation on xfa branch and turn on v8 deprecation warnings

R=vogelheim@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1142293003

4 years agoMerge to XFA: Fix Heap Overflow in CJBig2_Image::expand
JUN FANG [Tue, 19 May 2015 21:44:13 +0000]
Merge to XFA: Fix Heap Overflow in CJBig2_Image::expand

Integer overflow in CJBig2_Image::expand.
It causes the size of reallocated is not
expected.

BUG=483981
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1131023008

4 years agoMerge to XFA: Cleanup if early return from opj_j2k_copy_default_tcp_and_create_tcd().
Tom Sepez [Mon, 18 May 2015 22:53:57 +0000]
Merge to XFA: Cleanup if early return from opj_j2k_copy_default_tcp_and_create_tcd().

Original Review URL: https://codereview.chromium.org/1138033007
BUG=486538
TBR=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/1142133002

4 years agoMerge V8 API updates to xfa branch
Jochen Eisinger [Mon, 18 May 2015 22:38:00 +0000]
Merge V8 API updates to xfa branch

Set pointers in internal fields directly instead of wrapping them
Review URL: https://codereview.chromium.org/1139853003

Use phantom handles instead of weak handles
Review URL: https://codereview.chromium.org/1129253004

Replace deprecated with non-deprecated V8 APIs
Review URL: https://codereview.chromium.org/1126203010

Add myself to OWNERS file
Review URL: https://codereview.chromium.org/1133333005

Replace v8::Handle with v8::Local and v8::Persistent with v8::Global
Review URL: https://codereview.chromium.org/1138823004

TBR=tsepez@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1140033004

4 years agoMerge to XFA: Change FX_Alloc to FX_Try_Alloc in _JpegEncode
JUN FANG [Mon, 18 May 2015 21:36:00 +0000]
Merge to XFA: Change FX_Alloc to FX_Try_Alloc in _JpegEncode

This CL is used for:
1. keeping the same logic as before (the behaviour
   of FX_Alloc was changed for OOM).
2. fixing a potential integer overflow.

BUG=N/A
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1126013006

4 years agoMerge to XFA: Add safe FX_Alloc2D() macro
Tom Sepez [Mon, 18 May 2015 21:29:22 +0000]
Merge to XFA: Add safe FX_Alloc2D() macro

Original Review URL: https://codereview.chromium.org/1143663004

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1136673005

4 years agoMerge to XFA: Abort on OOM by default in FX_Alloc().
Tom Sepez [Fri, 15 May 2015 23:30:52 +0000]
Merge to XFA: Abort on OOM by default in FX_Alloc().

Original Review URL: https://codereview.chromium.org/1128043009
Original Review URL: https://codereview.chromium.org/1142463005

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1144683002

4 years agoMerge to XFA: Fix leaks in embedder test's FlateEncode() usage and in FlateEncode().
Lei Zhang [Fri, 15 May 2015 23:10:35 +0000]
Merge to XFA: Fix leaks in embedder test's FlateEncode() usage and in FlateEncode().

For FlateEncode(), error handling code leaked memory.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1144603002

(cherry picked from commit 1962d61b28df03284e3e5c6de6a19f397a066e68)

Review URL: https://codereview.chromium.org/1125413008

4 years agoMerge to XFA: Initialize members of CPDF_TextPageFind class.
Lei Zhang [Fri, 15 May 2015 22:38:01 +0000]
Merge to XFA: Initialize members of CPDF_TextPageFind class.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1137933004

(cherry picked from commit acae9257203971ee1e34d8d7573b7ba9a50041af)

BUG=

Review URL: https://codereview.chromium.org/1135793003

4 years agoMerge to XFA: Fix leaks in the embedder tests themselves.
Lei Zhang [Fri, 15 May 2015 22:36:02 +0000]
Merge to XFA: Fix leaks in the embedder tests themselves.

Also change EmbedderTest::TearDown() to match the destruction order in
Chromium's PDF code.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1138143003

(cherry picked from commit 61ffad8df484ab9b3f7d2f5519ec470fbc023b88)

Review URL: https://codereview.chromium.org/1138973004

4 years agoMerge to XFA: Remove FX_NEW_VECTOR() macros.
Tom Sepez [Fri, 15 May 2015 21:01:28 +0000]
Merge to XFA: Remove FX_NEW_VECTOR() macros.

Original Review URL: https://codereview.chromium.org/1135273004

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1134003007

4 years agoMerge to XFA: Fix potential UAF in ConcatInPlace.
Tom Sepez [Fri, 15 May 2015 16:09:22 +0000]
Merge to XFA: Fix potential UAF in ConcatInPlace.

Original Review URL: https://codereview.chromium.org/1130763007
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1123333004

4 years agoMerge to XFA: Make CFX_StringData be scoped by CFX_Bytestring and add methods.
Tom Sepez [Thu, 14 May 2015 21:36:01 +0000]
Merge to XFA: Make CFX_StringData be scoped by CFX_Bytestring and add methods.

Original Review URL: https://codereview.chromium.org/1142533002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1135673003

4 years agoCode alignment in issue 471991
JUN FANG [Thu, 14 May 2015 01:24:09 +0000]
Code alignment in issue 471991

BUG=471991
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1126273004

4 years agoFix integer overflow in conversion from float to integer.
JUN FANG [Thu, 14 May 2015 00:25:40 +0000]
Fix integer overflow in conversion from float to integer.

BUG=471991
R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1141613002

4 years agoMerge to XFA: Tidy public/ directory.
Tom Sepez [Thu, 14 May 2015 00:09:26 +0000]
Merge to XFA: Tidy public/ directory.

Original Review URL: https://codereview.chromium.org/1128003005

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1140653004

4 years agoFix a global buffer overflow issue in CXFA_ItemLayoutProcessor::CalculatePositionedCo...
JUN FANG [Wed, 13 May 2015 21:34:28 +0000]
Fix a global buffer overflow issue in CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos

BUG=471991
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1138993002

4 years agoMerge to XFA: Fix comparison of CFX_ByteString and CFX_WideString.
Tom Sepez [Wed, 13 May 2015 21:27:11 +0000]
Merge to XFA: Fix comparison of CFX_ByteString and CFX_WideString.

Original Review URL: https://codereview.chromium.org/1141763002

BUG=pdfium:160
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1140093003

4 years agoMerge to XFA: Make (and verify) public/ files compile under C.
Tom Sepez [Wed, 13 May 2015 00:28:08 +0000]
Merge to XFA: Make (and verify) public/ files compile under C.

The following files needed adjustment beyond a mechanical merge:
   fpdfsdk/src/fpdfview.cpp
   public/fpdf_formfill.h
   samples/pdfium_test.cc
   testing/embedder_test.cpp

Original Review URL: https://codereview.chromium.org/1130843003

BUG=pdfium:158
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1137233002

4 years agoMerge to XFA: Describe required properties of public/ files with a README.
Tom Sepez [Tue, 12 May 2015 22:46:48 +0000]
Merge to XFA: Describe required properties of public/ files with a README.

Original Review URL: https://codereview.chromium.org/1140833002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1128863005

4 years agoMerge to XFA: Restore checked strlen conversions.
Tom Sepez [Tue, 12 May 2015 21:58:44 +0000]
Merge to XFA: Restore checked strlen conversions.

Original Review URL: https://codereview.chromium.org/1133323003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1130903005

4 years agoMerge to XFA: NEW public API for pdfwindow font manipulation.
Tom Sepez [Tue, 12 May 2015 19:37:14 +0000]
Merge to XFA: NEW public API for pdfwindow font manipulation.

Original Review URL: https://codereview.chromium.org/1126283004

BUG=486818
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1137163002

4 years agoMerge to XFA: Add owners file for PDFium.
Tom Sepez [Mon, 11 May 2015 23:34:25 +0000]
Merge to XFA: Add owners file for PDFium.

Original Review URL: https://codereview.chromium.org/1136533003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1139673006

4 years agoMerge to XFA: Create top-level public/ header directory.
Tom Sepez [Mon, 11 May 2015 22:25:39 +0000]
Merge to XFA: Create top-level public/ header directory.

Original Review URL: https://codereview.chromium.org/1135913002

BUG=pdfium:154
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1136703003

4 years agoMerge to XFA: Fix a bunch of -Wunused-but-set-variable warnings.
Lei Zhang [Fri, 8 May 2015 20:52:49 +0000]
Merge to XFA:  Fix a bunch of -Wunused-but-set-variable warnings.

Also fix a few nits and other errors along the way.

Review URL: https://codereview.chromium.org/1098583002
Review URL: https://codereview.chromium.org/1135713004

(cherry picked from commit f0a169e6fd5718995fa6ef8749c8d16cdad84985)
(cherry picked from commit 470408c2ffe71e99cebad0d1d6887f1723f02cef)

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1133453006

4 years agoMerge to XFA: Move function prototypes to new doc_utils.h file
Tom Sepez [Fri, 8 May 2015 20:45:01 +0000]
Merge to XFA: Move function prototypes to new doc_utils.h file

Original Review URL: https://codereview.chromium.org/1128193004
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1137783002

4 years agoMerge to XFA: Fix compilation under chromium checkouts.
Tom Sepez [Fri, 8 May 2015 20:30:38 +0000]
Merge to XFA: Fix compilation under chromium checkouts.

Original Review URL: https://codereview.chromium.org/1132163002

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1128933004

4 years agoMerge to XFA: Better error from pdfium_test when page too big to render.
Tom Sepez [Fri, 8 May 2015 19:02:05 +0000]
Merge to XFA: Better error from pdfium_test when page too big to render.

Original Review URL: https://codereview.chromium.org/1124423006

BUG=pdfium:114
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1137753003

4 years agoMerge to XFA: Make CFX_StockFontArray more robust.
Lei Zhang [Thu, 7 May 2015 20:05:44 +0000]
Merge to XFA: Make CFX_StockFontArray more robust.

- Check bounds when accessing array.
- Remove potential memory leak.
- Merge duplicate code.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1094763002

(cherry picked from commit ee2fe42f9bf3ac6afc4f05f79629a3e34179a2b9)

Review URL: https://codereview.chromium.org/1128803003

4 years agoMerge to XFA: Support arrays in nonstd::unique_ptr<>.
Tom Sepez [Thu, 7 May 2015 00:48:47 +0000]
Merge to XFA: Support arrays in nonstd::unique_ptr<>.

Original Review URL: https://codereview.chromium.org/1130053003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1124353002

4 years agoMerge to XFA:Remove FX_STRSIZE casts, use safe conversions
Tom Sepez [Wed, 6 May 2015 23:17:06 +0000]
Merge to XFA:Remove FX_STRSIZE casts, use safe conversions

Original Review URL: https://codereview.chromium.org/1124043003

BUG=pdfium:153
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1132443002

4 years agoMerge to XFA: Fix a couple of divide by zero crashes in PNG/TIFF predictors.
Lei Zhang [Wed, 6 May 2015 22:27:42 +0000]
Merge to XFA: Fix a couple of divide by zero crashes in PNG/TIFF predictors.

BUG=484002
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1124563002

(cherry picked from commit 6ab919ff310fb02bab8cf43d92a5553b11cbbb61)

Review URL: https://codereview.chromium.org/1130903002

4 years agoMerge to XFA: Replace FX_NEW with new, remote tests from fxcodec
Lei Zhang [Wed, 6 May 2015 22:09:06 +0000]
Merge to XFA: Replace FX_NEW with new, remote tests from fxcodec

Review URL: https://codereview.chromium.org/1084303002

(cherry picked from commit cfc1a654ef3e8b65bc447815d35932c185bf1422)

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1125363002

4 years agoMerge to XFA: Replace FX_NEW with new, remove tests from fpdfapi
Lei Zhang [Wed, 6 May 2015 21:48:28 +0000]
Merge to XFA: Replace FX_NEW with new, remove tests from fpdfapi

Very few places where a change is required, but remove FX_NEW to show
they've been audited.

Review URL: https://codereview.chromium.org/1075953004

(cherry picked from commit 5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e)

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1125183006

4 years agoMerge to XFA: Fix a regression with cut off images.
Lei Zhang [Wed, 6 May 2015 21:00:24 +0000]
Merge to XFA: Fix a regression with cut off images.

This regressed in commit 3f41851 due to shadow variables.

BUG=478164
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1101443004

(cherry picked from commit 97d10aff654e42c1b7c3d2abf33fbcf8d341799e)

Review URL: https://codereview.chromium.org/1127163003

4 years agoMerge to XFA: Fix fx_string.h compile error under chromium checkouts.
Tom Sepez [Wed, 6 May 2015 19:59:20 +0000]
Merge to XFA: Fix fx_string.h compile error under chromium checkouts.

Original Review URL: https://codereview.chromium.org/1127043004
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1131553005

4 years agoMerge to XFA: Make sure string constructors are efficient on literals
Tom Sepez [Tue, 5 May 2015 22:51:17 +0000]
Merge to XFA: Make sure string constructors are efficient on literals

Besides the merge, there's one place where a wchar vs. wstring
comparison was being made that no longer compiled.

Original Review URL: https://codereview.chromium.org/1117263004

BUG=pdfium:151
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1116163003

4 years agoMerge to XFA: Fix issues with != and == in fx_basic_wstring
Tom Sepez [Mon, 4 May 2015 22:29:42 +0000]
Merge to XFA: Fix issues with != and == in fx_basic_wstring

Original Review URL: https://codereview.chromium.org/1127753002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1119753004

4 years agoMerge to XFA: Kill FX_DEFINEHANDLE
Tom Sepez [Mon, 4 May 2015 22:18:56 +0000]
Merge to XFA: Kill FX_DEFINEHANDLE

Original Review URL: https://codereview.chromium.org/1129433002

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1122903002

4 years agoMerge to XFA: Fix issuse with != and == shown by fx_basic_bstring unit tests.
Tom Sepez [Mon, 4 May 2015 21:14:33 +0000]
Merge to XFA: Fix issuse with != and == shown by fx_basic_bstring unit tests.

Original Review URL: https://codereview.chromium.org/1125703004
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1126643003

4 years agoMerge to XFA: Backfill some FX String/StringC unit tests for == and !=.
Tom Sepez [Sat, 2 May 2015 00:07:19 +0000]
Merge to XFA: Backfill some FX String/StringC unit tests for == and !=.

Original Review URL: https://codereview.chromium.org/1118973005
Original Review URL: https://codereview.chromium.org/1122573002

R=thestig@chromium.org
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1126433002

4 years agoMerge to XFA: CFX_ByteString/WideString header changes
Tom Sepez [Fri, 1 May 2015 23:12:48 +0000]
Merge to XFA: CFX_ByteString/WideString header changes

Original Review URL: https://codereview.chromium.org/1117413002
Original Review URL: https://codereview.chromium.org/1118983003

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1125493002

4 years agoMerge to XFA: Take adavange of unused bytes at end of CFX strings
Tom Sepez [Thu, 30 Apr 2015 22:46:34 +0000]
Merge to XFA: Take adavange of unused bytes at end of CFX strings

Original Review URL: https://codereview.chromium.org/1112423003
Original Review URL: https://codereview.chromium.org/1120703003

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1120813003

4 years agoMerge to XFA: Fix V8 array buffer allocator.
Tom Sepez [Thu, 30 Apr 2015 22:19:03 +0000]
Merge to XFA: Fix V8 array buffer allocator.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1118143003

4 years agoMerge to XFA: Make CFX_WideString::LockBuffer() completely unused.
Tom Sepez [Tue, 28 Apr 2015 21:36:02 +0000]
Merge to XFA: Make CFX_WideString::LockBuffer() completely unused.

Original Review URL: https://codereview.chromium.org/1053613004
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1115493002

4 years agoMerge to XFA: Pin V8 version until initialization issue in b584bab resolved.
Tom Sepez [Tue, 28 Apr 2015 21:31:15 +0000]
Merge to XFA: Pin V8 version until initialization issue in b584bab resolved.

Also make a Handle => Local change for XFA required at
https://chromium.googlesource.com/v8/v8.git/+/202a97c88eb6807915135a1e6be9aa921cd8efac
to fix compile.

Original Review URL https://codereview.chromium.org/1108913004/
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1108973005

4 years agoMerge to XFA: SEGV in CFX_BaseSegmentedArray::Iterate().
Tom Sepez [Mon, 27 Apr 2015 20:33:26 +0000]
Merge to XFA: SEGV in CFX_BaseSegmentedArray::Iterate().

Original Review URL: https://codereview.chromium.org/1110653002

R=thestig@chromium.org
TBR=thestig@chromium.org
BUG=481363

Review URL: https://codereview.chromium.org/1110763002

4 years agoMerge to XFA: Fix windows-specific usage of CFX_WideStr::operator LPCWSTR().
Tom Sepez [Mon, 27 Apr 2015 20:22:54 +0000]
Merge to XFA: Fix windows-specific usage of CFX_WideStr::operator LPCWSTR().

Original Review URL: https://codereview.chromium.org/1103343002

R=brucedawson@chromium.org
TBR=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1105253002

4 years agoMerge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString().
Tom Sepez [Mon, 27 Apr 2015 19:06:58 +0000]
Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString().

Original Review URL: https://codereview.chromium.org/1101933003
TBR=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1108903002

4 years agoMerge to XFA: Remove unused nParamNum values from JS method tables.
Tom Sepez [Fri, 24 Apr 2015 01:14:26 +0000]
Merge to XFA: Remove unused nParamNum values from JS method tables.

Original Review URL: https://codereview.chromium.org/1084183008
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1105813002

4 years agoMerge to XFA: Kill overloaded cast operators in CJS_Value.
Tom Sepez [Thu, 23 Apr 2015 18:31:31 +0000]
Merge to XFA: Kill overloaded cast operators in CJS_Value.

Original Review URL: https://codereview.chromium.org/1096813008
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1106663002

4 years agoMerge to XFA: Fix segmentation fault 'denial of service condition'
JUN FANG [Thu, 23 Apr 2015 17:12:19 +0000]
Merge to XFA: Fix segmentation fault 'denial of service condition'

BUG=467392
R=thestig@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1064713008

4 years agoMerge to XFA: Add missing operators for CFX_xxxString combo patch.
Tom Sepez [Wed, 22 Apr 2015 19:29:21 +0000]
Merge to XFA: Add missing operators for CFX_xxxString combo patch.

This pulls in:
Review URL: https://codereview.chromium.org/1099193002
Review URL: https://codereview.chromium.org/1090303003
Review URL: https://codereview.chromium.org/1084293003
Review URL: https://codereview.chromium.org/1099213002

Plus one fix to an XFA file to fix compilation.

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1095893005

4 years agoMerge to XFA: Kill CFX_StringBufTemplate.
Tom Sepez [Tue, 21 Apr 2015 22:24:49 +0000]
Merge to XFA: Kill CFX_StringBufTemplate.

Original Review URL: https://codereview.chromium.org/1098203002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1080633008

4 years agoMerge to XFA: Fix a crashier due to images with abnormal size
JUN FANG [Tue, 21 Apr 2015 16:58:09 +0000]
Merge to XFA: Fix a crashier due to images with abnormal size

BUG=453553
R=thestig@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1093323003

4 years agoMerge to XFA: Remove Release() combo patch.
Tom Sepez [Mon, 20 Apr 2015 23:33:30 +0000]
Merge to XFA: Remove Release() combo patch.

Includes:
Original Review URL: https://codereview.chromium.org/1098043002
Original Review URL: https://codereview.chromium.org/1097843003
Original Review URL: https://codereview.chromium.org/1093213002

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1092033004

4 years agoMerge to XFA: Set m_FontType in CPDF_Font() constructor.
Tom Sepez [Fri, 17 Apr 2015 20:17:49 +0000]
Merge to XFA: Set m_FontType in CPDF_Font() constructor.

Original Review URL: https://codereview.chromium.org/1060813003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1060843005

4 years agoMerge to XFA: add nonstd::unique_ptr
Tom Sepez [Fri, 17 Apr 2015 20:05:21 +0000]
Merge to XFA: add nonstd::unique_ptr

Original Review URL: https://codereview.chromium.org/1091283002

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1098653006

4 years agoAdjust the order of const and static
JUN FANG [Fri, 17 Apr 2015 18:58:52 +0000]
Adjust the order of const and static

BUG=N/A
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1092993002

4 years agoFix an issue 'heap use after free'
JUN FANG [Fri, 17 Apr 2015 18:46:08 +0000]
Fix an issue 'heap use after free'

This fix is for covering more scenarios. Some faces like Foxit defined faces and MM faces are managed in built-in manager. They are released in built-in manager not in fontMgr.

BUG=452793
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1095733003

4 years agoFix heap use after free in FT_Stream_ReleaseFrame
JUN FANG [Thu, 16 Apr 2015 22:19:04 +0000]
Fix heap use after free in FT_Stream_ReleaseFrame

Adjust the release order of resource to fix this issue.

BUG=452793
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1082023002

4 years agoXFA merge: Fix pdfium standalone to compile with VS 2015.
Bruce Dawson [Thu, 16 Apr 2015 20:49:57 +0000]
XFA merge: Fix pdfium standalone to compile with VS 2015.

This change disables several warnings that fire frequently
in pdfium and are not practical to fix at this time.

Originally on https://codereview.chromium.org/1096463005

TBR=tsepez@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/1088943003

4 years agoMerge to XFA: Fix offset outside bounds of constant string warnings
JUN FANG [Wed, 15 Apr 2015 19:00:53 +0000]
Merge to XFA: Fix offset outside bounds of constant string warnings

BUG=380476
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1061013003

4 years agoMerge to XFA: Make FX_NEW throw on OOM.
Tom Sepez [Wed, 15 Apr 2015 17:30:05 +0000]
Merge to XFA: Make FX_NEW throw on OOM.

Original Review URL: https://codereview.chromium.org/1082253003
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1061843005

4 years agoFix two new / free mismatches
Tom Sepez [Tue, 14 Apr 2015 22:55:35 +0000]
Fix two new / free mismatches

R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1085963002

4 years agoFix XFA compile under clang
Tom Sepez [Tue, 14 Apr 2015 21:31:25 +0000]
Fix XFA compile under clang

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1052873006

4 years agoMerge to XFA: Kill CFX_Object.
Tom Sepez [Tue, 14 Apr 2015 20:50:34 +0000]
Merge to XFA: Kill CFX_Object.

Not just a simple merge, but changes to remove CFX_Object from XFA.

Original Review URL: https://codereview.chromium.org/1088733002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1087053002

4 years agoMerge to XFA: Fix a heap overflow in CJBig2_Context::parseSymbolDict
JUN FANG [Mon, 13 Apr 2015 17:34:10 +0000]
Merge to XFA: Fix a heap overflow in CJBig2_Context::parseSymbolDict

BUG=476107
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1080893002

4 years agoMerge to XFA: Fix compiling warnings on Windows
Jun Fang [Sat, 11 Apr 2015 18:34:43 +0000]
Merge to XFA: Fix compiling warnings on Windows

TBR=tsepez@chromium.org

BUG=N/A

Review URL: https://codereview.chromium.org/1081663002

4 years agoMerge to XFA: Fix a heap buffer overflow issue in CPDF_CMap::GetNextChar
JUN FANG [Sat, 11 Apr 2015 16:33:23 +0000]
Merge to XFA: Fix a heap buffer overflow issue in CPDF_CMap::GetNextChar

Add a check to make sure offset is less than the size of string in the function of GetNextChar().

BUG=471651
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1067073003

4 years agoXFA port: Fix the noisiest variable shadowing warnings in pdfium.
Bruce Dawson [Fri, 10 Apr 2015 22:18:07 +0000]
XFA port: Fix the noisiest variable shadowing warnings in pdfium.

Three functions in fx_coordinates.h account for 60% of the warnings
when building with VS 2015, due to variable shadowing. Renaming the
function parameters is safe, resolves the warnings, and reduces
confusion.

From https://codereview.chromium.org/1077083003

TBR=tsepez@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/1077283002

4 years agoMerge to XFA: Better fix for snprintf non-termination on windows.
Tom Sepez [Fri, 10 Apr 2015 21:54:13 +0000]
Merge to XFA: Better fix for snprintf non-termination on windows.

TBR=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1073313003