summaryrefslogtreecommitdiff
path: root/core/src
AgeCommit message (Collapse)Author
2015-12-17Merge to XFA: Correctly extracting email addressesWei Li
An email address contains user name part and host name part. User name allows dash or underscore, but not leading/ending/double period. Host name doesn't allow leading/ending/double period either. BUG=489107 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1530763005 . (cherry picked from commit cc70b7b55c9edcd0ff038f59080699060fbbede1) Review URL: https://codereview.chromium.org/1532303002 .
2015-12-17Merge to XFA: Fix a sentinel length value used in CFX_CMapByteStringToPtr::SetAtOliver Chang
It looks like an key length of 0 was incorrectly assumed to denote an free entry. Fixes a memory leak in FPDFViewEmbeddertest.Crasher_451830 due to values with empty keys being incorrectly overwritten. TBR=tsepez@chromium.org Original Review URL: https://codereview.chromium.org/1534953002 . (cherry picked from commit 391783579c5a8aad346b56903b51e6551600550b) Review URL: https://codereview.chromium.org/1532283002 .
2015-12-17Merge to XFA: FX_NAMESPACE_DECLARE pointless.Tom Sepez
Orignal Review URL: https://codereview.chromium.org/1534003002 . (cherry picked from commit fed9dd90c086c854ef13440e6022602eb9f91cfc) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1537463003 .
2015-12-17Merge to XFA: Tidy CPDF_RenderContextTom Sepez
Original Review URL: https://codereview.chromium.org/1536623004 . (cherry picked from commit 761660c4074269ac806d06c9bef70e4e9fb0eb29) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1531423002 .
2015-12-16Merge to XFA: Make clang_warning_flags work for standalone builds.Lei Zhang
Also fix a newly introduced override warning. Also define a host_clang GYP variable. TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1532723003 . Review URL: https://codereview.chromium.org/1533763002 . (cherry picked from commit e096ca507db9944aebc47d6c2cc1c6fab39498c5) (cherry picked from commit 0a9158b99a2002fb82301ebec20dbc23b3fc084c) Review URL: https://codereview.chromium.org/1535603003 .
2015-12-15Merge to XFA: Fix free entry handling for cross reference v4 reading.Wei Li
While reading free entries in v4 cross reference table, changing the start_objnum caused crossref table built wrong. BUG=569795 TBR=jun_fang@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/1527823003 . (cherry picked from commit c89cd979fb8654d85b822909cba9263d5f13760c) Review URL: https://codereview.chromium.org/1528153003 .
2015-12-14Merge to XFA: Fix Windows build failure due to double vs float mismatch.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1525853003 . (cherry picked from commit 4d4c61ea4e39135b126879dd6d7bc99a59a3a843) Review URL: https://codereview.chromium.org/1524023002 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo == NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1520063002 . (cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff) Review URL: https://codereview.chromium.org/1528763003 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo != NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
2015-12-14Merge to XFA: Remove FX_BSTRC.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 .
2015-12-14Merge to XFA: Fix a memory leak in FPDFPageFuncEmbeddertest.Lei Zhang
TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1514283002 . (cherry picked from commit 1407c979a3ba8599546468d461f5403f317bddd3) Review URL: https://codereview.chromium.org/1525013002 .
2015-12-14Merge to XFA: Properly land "Fix hint table loading issues."Oliver Chang
R=thestig@chromium.org TBR=thestig@chromium.org BUG=566179 Original Review URL: https://codereview.chromium.org/1524983002 . (cherry picked from commit 1eb7477b3e7c5cb7c54ca364810ab9a24acad4f9) Review URL: https://codereview.chromium.org/1525793003 .
2015-12-14Merge to XFA: Fix hint table loading issues.Oliver Chang
BUG=566179 TBR=thestig@chromium.org Original Review URL: https://codereview.chromium.org/1523523002 . (cherry picked from commit be8408f43bcfd69a74007a340a4c034004146c60) Review URL: https://codereview.chromium.org/1518403003 .
2015-12-11Merge to XFA: Fix memory leaks involving InsertIndirectObject()Jun Fang
BUG=447331 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1514093002 . Review URL: https://codereview.chromium.org/1515403003 .
2015-12-11Merge to XFA: Fix a regression for parsing '/' - commit a568ff2d was too ↵Lei Zhang
strict. BUG=pdfium:326 TBR=dml@google.com Review URL: https://codereview.chromium.org/1521543002 . (cherry picked from commit ebc7695c60fc3e4afbfa6d9db162a71b190bf685) Review URL: https://codereview.chromium.org/1519323002 .
2015-12-10Merge to XFA: Fix integer and bounds issues in sycc4{22,44}_to_rgb.Oliver Chang
Also clean up while we're here. BUG=557223 TBR=tsepez@chromium.org Original Review URL: https://codereview.chromium.org/1512833008 . (cherry picked from commit 08750d0400f1635ac33c3234cb11b192f31a1eeb) Review URL: https://codereview.chromium.org/1521473003 .
2015-12-10Merge to XFA: Replace several more CFX_MapPtrToPtr with std::set or std::mapTom Sepez
Original Review URL: https://codereview.chromium.org/1520643002 . (cherry picked from commit 7db2a535f163e7ce5995da12161ebd0214f0f75a) Original Review URL: https://codereview.chromium.org/1511413008 . (cherry picked from commit 168cfb7ee0f2abbd2bddb7e7d8b430a6d8c6c120) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1515613006 .
2015-12-10Merge to XFA: Remove CFX_AffineMatrix/CPDF_MatrixTom Sepez
Review URL: https://codereview.chromium.org/1513363002 . (cherry picked from commit f32c969bce6743fca1e7ff796b54a1692d26d7f0) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1519693002 .
2015-12-10Merge to XFA: Cleanup CPDF_DIBSource::LoadColorInfo() and ValidateDictParam().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1507043004 . (cherry picked from commit d9324d8f7345d4546c06c4a9d6cd497b0f7f3ad2) Review URL: https://codereview.chromium.org/1512203003 .
2015-12-09Merge to XFA: Prevent infinite looping in CPDF_Parser::LoadAllCrossRefV5().Lei Zhang
BUG=pdfium:298 TBR=weili@chromium.org Review URL: https://codereview.chromium.org/1496703005 . (cherry picked from commit 93181f9a20db7ac706bb9405750303db93762a5b) Review URL: https://codereview.chromium.org/1514783002 .
2015-12-09Fix heap-use-after-free in FT_Stream_ReleaseFrameJun Fang
BUG=452793,561478 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512873002 .
2015-12-09Merge to XFA: Get rid of most uses of CFX_PtrArray.Tom Sepez
Original Review URL: https://codereview.chromium.org/1518593002 . (cherry picked from commit 035359cd8ddb555fa33b6133db4fd405e4660712) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1513103002 .
2015-12-09XFA: Revert UTF16LE_Encode changesOliver Chang
Revert "Fix embedder test failures introduced by commit c70b19aad245" This reverts commit 8d89e65897d8b6cf7899e7a82d9d381c3ad327cb. Revert "Fix invalid buffer length set in CFX_WideString::UTF16LE_Encode()" This reverts commit c70b19aad245fb1ed39bf8c264d991555f4c5a58. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1516643002 .
2015-12-08Merge to XFA: Fix rendering with built-in CID fontsJun Fang
The root cause is that FXFONT_SUBST_EXACT is wrongly set even no any subset font was found. It causes m_bCIDIsGID to be wrongly set as TRUE in CPDF_CIDFont::_Load(). BUG=534945 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1502083002 . Review URL: https://codereview.chromium.org/1504263002 .
2015-12-06Merge to XFA: fix for stream object readingWei Li
Loosen a check for earlier version of PDF files. When the bytes with specified length are followed by 'endstream' keyword, even if there is no EOL marker before the keyword, it signals the end of stream. BUG=551258 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1499433002 . (cherry picked from commit 0ff66089c87ab6e3adaaff0ec69728ce7a8d8299) Review URL: https://codereview.chromium.org/1504723002 .
2015-12-04Merge to XFA: Fix an incorrect check in CPDF_DataAvail::CheckHintTables.Oliver Chang
R=tsepez@chromium.org TBR=tsepez@chromium.org BUG=566179 Original Review URL: https://codereview.chromium.org/1504513002 . (cherry picked from commit 2d16308298f236ae81aa11a53f2d4e25b502dfac) Review URL: https://codereview.chromium.org/1501123002 .
2015-12-01Merge to XFA: Add basic checking for RebuildCrossRefWei Li
RebuildCrossRef function returns false when we can not find file trailer or any indirect object. This serves as a basic file format checking. BUG=pdfium:215 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1476163002 . (cherry picked from commit f14da1d58e8e12633c7a47e6efd5ffe43bb37b4b) Review URL: https://codereview.chromium.org/1486383002 .
2015-11-30Allow building non-XFA (master) on the XFA branch.Tom Sepez
This first pass is GYP-only, will do GN in the next CL. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1480403002 .
2015-11-25Manual fixups to PDF_ENABLE_XFA in core/Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477663003 .
2015-11-25Inflict PPDF_ENABLE_XFA ifdefs on XFA core/Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1471323004 .
2015-11-25Merge to XFA: Fix two memory leaks from pdfium_unittestsQin Zhao
- remove redundant alloc in fx_codec_jpx_unittest.cpp - free memory allocated by HexDecode calls in fpdf_parser_decode_unittest.cpp BUG=PDFium:239 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1467183006 . (cherry picked from commit 6c2d736011c09266015d3e2a0b9c08aeba1bbf31) Review URL: https://codereview.chromium.org/1477833002 .
2015-11-25Fix invalid buffer length set in CFX_WideString::UTF16LE_Encode()Jun Fang
BUG=pdfium:275 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1443603002 .
2015-11-24Merge to XFA: Fix a NULL pointer crash in the CJBig2_Image copy constructor.Lei Zhang
Also change the copy ctor to take a const ref. BUG=560520 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1472113002 . (cherry picked from commit d03bc01003ae2603dafdc07b901ffef0a509a2b9) Review URL: https://codereview.chromium.org/1478473002 .
2015-11-20Make XFA core/ look like master (part N).Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1463173003 .
2015-11-20Merge to XFA: Change |CCodec_ScanlineDecoder::m_Pitch| to FX_DWORDOliver Chang
This matches the type of the corresponding |CFX_DIBSource::m_Pitch|, where integer overflow is checked for FX_DWORD. This change is propagated to many other places. Also, check for integer overflow in |CCodec_RLScanlineDecoder::Create| during the calculation of |m_Pitch| since it aligns to 4 bytes while overflow was was previously checked without this alignment. TBR=tsepez@chromium.org BUG=555784 Review URL: https://codereview.chromium.org/1460033002 . (cherry picked from commit e7950df70a2fd658f466751b29483436cb31e829) Review URL: https://codereview.chromium.org/1461363002 .
2015-11-20Reduce diffs with master in coreTom Sepez
This week's version. Mostly whitespace, but takes the master version of core/src/fxge/ge/fx_ge_text.cpp verbatim. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1462923004 .
2015-11-19Merge to XFA: Cache object numbers in CPDF_Parser::ParseIndirectObject().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1458633004 . (cherry picked from commit 0c8e6c1f39f20985a3efb17292e46c476194183a) Review URL: https://codereview.chromium.org/1461693005 .
2015-11-19Merge to XFA: Add more overrides.Lei Zhang
Using Chromium's clang + build options, there's more override warnings. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1453643002 . (cherry picked from commit 126ba519bdd489ec6c285d1410dcae773e8ef673) Review URL: https://codereview.chromium.org/1458373002 .
2015-11-19Merge to XFA: Add a missing setjmp() to CCodec_JpegDecoder::v_GetNextLine().Oliver Chang
If jpeg_read_scanlines() ends up calling the error callback, we longjmp into some undefined state. BUG=558840 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1463563003 . (cherry picked from commit 06e33aec03f13c76d9eff5c09cb03e142b0c5ef1) Review URL: https://codereview.chromium.org/1462253004 .
2015-11-17Make CPDF_InterForm::AddStandardFont take a non-const document pointer.Lei Zhang
Instead of taking a const pointer, and then casting away the const-ness. Also remove similar, but dead CPDF_InterForm methods. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1456763003 . Review URL: https://codereview.chromium.org/1456823002 . Review URL: https://codereview.chromium.org/1452843005 . (cherry picked from commit 9c62cadff466f26307bd06ed1e9df2c1b5f25a32) (cherry picked from commit 447946588d6bbd4d5bc34477a09dd983285c507e) (cherry picked from commit b2a4c976841863e89804a2643eebccf881c57584) Review URL: https://codereview.chromium.org/1457703002 .
2015-11-17Merge to XFA: Add more fxcrt string sanity tests.Lei Zhang
Sadly I've gotten these to fail with Chromium debug builds. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1447163004 . (cherry picked from commit 191333dbc8889a60ff43a10176cc0ae87dc11d89) Review URL: https://codereview.chromium.org/1453403002 .
2015-11-16Merge to XFA: Reland "Cleanup some numeric code.""Dan Sinclair
This reverts commit 0569ab0b11b723d9bca4ddd642b0cf8828c4bdd1. This changes the various comparisons of char >= '0' && char <= '9' and char < '0' || char > '9' to use std::isdigit checks. It also cleans up a handful of hex to digit conversions to call one common method. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1449873003 . (cherry picked from commit 3f148915d12f54a946a0c0bf526162b79c39d650) Review URL: https://codereview.chromium.org/1452673002 .
2015-11-12Merge to XFA: Remove relative includes.Lei Zhang
That refer to parent directories. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1434223002 . (cherry picked from commit 22bc4227fbbda5a5e9abad2a2c0a98c04fe7f228) Review URL: https://codereview.chromium.org/1439223003 .
2015-11-12Merge to XFA: Clear decoders after the image decoder in the /Filter array.Oliver Chang
During decoding, when an image decoder is encountered, any subsequent decoders are ignored, but remain in the array. However, later on CPDF_DIBSource::ValidateDictParam expects the image decoder to be the last in the array, causing issues. A check is also added in CPDF_DIBSource::GetScanline to ensure that the calculated pitch value is <= the (4-aligned) pitch value in the cached bitmap to prevent future issues. Also cleans up some NULL usages. BUG=552046 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1406943005 . (cherry picked from commit 182d129bcee8f7731b9bbfde0064295ad3b37271) Review URL: https://codereview.chromium.org/1436153003 .
2015-11-11Merge to XFA: Fix / simplify CFX_FolderFontInfo::GetFontData() behavior.Lei Zhang
The GetFontData() behavior in FPDF_SYSFONTINFO seems reasonable. Also do some code cleanup. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1425023003 . (cherry picked from commit e0c16d7461ca8317433d93835e4c36a84157cbef) Review URL: https://codereview.chromium.org/1438943002 .
2015-11-11Merge to XFA: Fix extraction of colour components in ↵Oliver Chang
CPDF_DIBSource::DownSampleScanline32Bit Previously, if |m_bpc| was < 8 (e.g. 4), this function may still try to access the source components as if |m_bpc| == 8. Even when it fell into the codepath that tried to do the right thing in this case, it was wrong. BUG=554151 TBR=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/9b99615806e358fdb396d1cb162ee2e69c2a20ec Review URL: https://codereview.chromium.org/1433423002 . (cherry picked from commit e21fe98d5b5da7da01503b985b07b90c8e811689) Review URL: https://codereview.chromium.org/1441563002 .
2015-11-11Merge to XFA: Cleanup CPDF_ApSettings and CJS_Parameters.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1432863004 . (cherry picked from commit 56e3da27d8bed8a6c03274b7b946e3f6d6ac11f4) Review URL: https://codereview.chromium.org/1436843003 .
2015-11-10Merge to XFA: Fix CalculatePitch32() issues.Tom Sepez
Original Review URL: https://codereview.chromium.org/1432073003 . (cherry picked from commit 46960a43145ab978ca3c90cb6133bb3d5600ad1d) BUG=pdfium:273 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1424473008 .
2015-11-10Merge to XFA: Prevent buffer underflow in CPDF_TextObject::CalcPositionDataOliver Chang
R=tsepez@chromium.org TBR=tsepez@chromium.org BUG=554115 Review URL: https://codereview.chromium.org/1435473004 . (cherry picked from commit 46d2e278f62454ed2392630b6d18d33d380a20eb) Review URL: https://codereview.chromium.org/1436673003 .
2015-11-10Merge to XFA: Cleanup CPDF_Stream:Lei Zhang
- Remove CPDF_Stream::Create() and checks that it might fail. - Remove m_pCryptoHandler that's always a nullptr. - Remove m_FileOffset that's always 0. - Rename file version of InitStream() to InitStreamFromFile(). - Use IsMemoryBased() in more places. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1415163009 . (cherry picked from commit e6e16954f0cdc324849fca9da883be8f131b3834) Review URL: https://codereview.chromium.org/1418493006 .