summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-23Fix two CloneNonCycle issuesWei Li
CloneNonCycle() tries to detect cyclic object references without copying them. There are two issues: -- for elements in an array or a dictionary, they should be able to refer to the same object, which are not cyclic; -- for cyclic referenced elements in an array or a dictionary, do not clone the element at all. Having nullptr or <key, nullptr> as an element, like we did before, might cause crash when the element being accessed. BUG=chromium:701860 Change-Id: Id0304accde76ed06fa5ce640994c7628359600fb Reviewed-on: https://pdfium-review.googlesource.com/3156 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-23Handle the Clip command list being emptyDan Sinclair
If the command list is already empty when we attempt to restore the clip we will access outside the command array. BUG=chromium:704442 Change-Id: Ib7c44e14f0de175f1c10c1a538d16987aa49bf8a Reviewed-on: https://pdfium-review.googlesource.com/3159 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Revert "Remove CFX_FixedBufGrow"Nicolás Peña
This reverts commit 55d1d0191ea8316df32858d8cc62fb7c620e8613. Reason for revert: Slowing down corpus tests by a lot on Mac/Win Original change's description: > Remove CFX_FixedBufGrow > > This Cl replaces the CFX_FixedBufGrow class with std::vector. > > Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe > Reviewed-on: https://pdfium-review.googlesource.com/3138 > Reviewed-by: Tom Sepez <tsepez@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Iaee27570f140b2033b5d8fb8f3077fc839558d64 Reviewed-on: https://pdfium-review.googlesource.com/3158 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-23Cleanup DocType definesDan Sinclair
This Cl synchronizes the DocType's defined in XFA with the DOCTYPE flag used in public/. The internal XFA version is converted to an enum class. Change-Id: I1f7be71a200c1ec0f09f9b08099791da1f4fa2e4 Reviewed-on: https://pdfium-review.googlesource.com/3152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-23Remove unused XFA_VALIDATE codeDan Sinclair
The XFA Validation flag is always set to preSubmit. This Cl removes the flag and other values and just uses the preSubmit option. Change-Id: Ic2e88d72ad94b605a2da355c4c0a56def47df73e Reviewed-on: https://pdfium-review.googlesource.com/3153 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-23Remove unused invalidate flagDan Sinclair
The flag passed to the DocEnvironment::InvalidateRect method is not used. Remove. Change-Id: I2a996e0bbf7f6a010c985bf4e9df0084dc0a7ea3 Reviewed-on: https://pdfium-review.googlesource.com/3154 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-23Remove dead CFX_Edit code and fix some typos.Lei Zhang
Change-Id: Ieaac36e06db3d1e2b857d999a7d3d9cd5c5a9506 Reviewed-on: https://pdfium-review.googlesource.com/3118 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-22Return errors after validation instead of ASSERT in CPDF_DataAvailNicolas Pena
Change-Id: I909deca1d0bfc6de5ac0fd2e6956f9b918caf17a Reviewed-on: https://pdfium-review.googlesource.com/3157 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Use std::vector in cfde_txtedtenginechromium/3049Tom Sepez
Change-Id: I651782e6eb6b14580a89d9d613404e7984a76cf0 Reviewed-on: https://pdfium-review.googlesource.com/3141 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-22Use unique_ptr in xfa_ffpushbutton.hTom Sepez
Change-Id: I605c1219b1090eb13d22237fa1d61d9defe137d5 Reviewed-on: https://pdfium-review.googlesource.com/3151 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Use unique_ptr for CFDE_XMLDoc::m_pRootTom Sepez
Remove some less helpful helper methods. Change-Id: Id027e31b6584156263c4aa0c2888e91fa44e4b0b Reviewed-on: https://pdfium-review.googlesource.com/3150 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-22Convert to use info.Holder instead of info.ThisDan Sinclair
The definition of info.This is changing in v8. We want to work with the Holder and not what info.This will be returning in the future. Change-Id: Ic988f62d225569398cfde84ab51c72ae620a991a Reviewed-on: https://pdfium-review.googlesource.com/3147 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-22Remove unused docview flagDan Sinclair
When creating the XFA doc view we always pass the same docview flag (0). So, the map will only ever have one item in it. This Cl simplifies the code by removing the map and just dealing with a single doc view. Change-Id: If17e2cda4c3f6c1f45dec921844f09538cc890fc Reviewed-on: https://pdfium-review.googlesource.com/3149 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-22Cleanup fx_dib_composite Part 4Nicolas Pena
More method simplification, new helper GetGrayWithBlend Change-Id: Ice28591c590e2210f3b2864ac16b2d57abedeeb0 Reviewed-on: https://pdfium-review.googlesource.com/3145 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Fix ASSERT in CPDF_Data_AvailNicolas Pena
If ParseIndirectObjectAt fails, the replaced object will be null. So we can't ASSERT the output of ValidatePage. CL introducing the ASSERT: https://codereview.chromium.org/2483633002/ BUG=chromium:702897 Change-Id: Ib6e8c0bccaf2c05893f0abef27d431e112064865 Reviewed-on: https://pdfium-review.googlesource.com/3146 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Fix Mac tests on 10.12Nicolas Pena
md5's with text are changed, so need to allow both the previous and the new one. Pixel tests with text also fail on 10.12, so suppressing those. Found many unexpected successes, so will unsuppress those once all bots are 10.12 BUG=chromium:703912 Change-Id: I6b34aa2f581eb8ea705f3876960b49c89e249347 Reviewed-on: https://pdfium-review.googlesource.com/3144 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Use moar unique_ptrs in CXFA_DocumentTom Sepez
Change-Id: I3300b3013396885ae2c9f85caee630915799e181 Reviewed-on: https://pdfium-review.googlesource.com/3143 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Use unique_ptr in cfx_saxreader.hTom Sepez
Change-Id: Ia024aff32e7e6fb2d5f6454b9856518a76365de2 Reviewed-on: https://pdfium-review.googlesource.com/3142 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Remove CFX_FixedBufGrowDan Sinclair
This Cl replaces the CFX_FixedBufGrow class with std::vector. Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe Reviewed-on: https://pdfium-review.googlesource.com/3138 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Make CPVT_WordPlace more conformant with the prevailing idioms.Tom Sepez
Add relational operators to replace CmpWord(). Leave CmpLine() for the moment as it saves some work. Remove CmpSec() and just inline comparison of the one member. Invert IsExist() as IsEmpty(). There is a big philosophical discussion as to whether things that are empty exist. I say they do, but they're just empty. Rename Default() to Reset(). Default sounds like a noun. Add AdvanceSection() method and call as appropriate. Change-Id: I01d9479f63a4860e0fd228255540d6d94dc24a9f Reviewed-on: https://pdfium-review.googlesource.com/3139 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-21Move colorspace specific code to colorspace classDan Sinclair
This Cl moves the Matrix and Vector code which is only used by the colorspace code into the colorspace cpp file. Change-Id: Ie37bcee0978278a56d345e63704494b5b67e5b24 Reviewed-on: https://pdfium-review.googlesource.com/3137 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-21Fixup mac release skia buildDan Sinclair
BUG=pdfium:11 Change-Id: I375460695f10753d81535533a0b3fc607a38652e Reviewed-on: https://pdfium-review.googlesource.com/3140 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Replace CFX_FileSizeListArray with a std::mapDan Sinclair
This CL replaces the FileSizeListArray code with a std::map. Change-Id: Ic158ad95e7055693168d186ba428806a59b04c95 Reviewed-on: https://pdfium-review.googlesource.com/3136 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Cleanup fx_dib_composite part 3Nicolas Pena
- Merged two methods into CompositeRow_AToMask - Simplified CompositeRow_Argb2Graya a lot Change-Id: Icc96ac30121082ef4d6cb170d1e4f918b109b1be Reviewed-on: https://pdfium-review.googlesource.com/3134 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Pop when Pages is malformed and has no kidsNicolas Pena
If the Kids array for the Pages dictionary does not exist, just treat this dictionary as the unique page in the document. BUG=chromium:702883 Change-Id: I9cb9645a53d60306ffe563f9b27cbbd37442f4ec Reviewed-on: https://pdfium-review.googlesource.com/3135 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-21Replace CPVT_ArrayTemplate in cpdf_variabletext.cpp and remove it.chromium/3048Tom Sepez
Change-Id: I4354a841d6e2d4f30ccb298d13dffa49b9f3a3b3 Reviewed-on: https://pdfium-review.googlesource.com/3131 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-21Use std::vector for m_HotKeysTom Sepez
Change-Id: I637fe236ae351bf6fcf8aa2913b94f55d997c612 Reviewed-on: https://pdfium-review.googlesource.com/3132 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-21Combine more RTF and TXT Break codeDan Sinclair
This Cl conbines several more methods from RTFBreak and TXTBreak into the common Break baseclass. Change-Id: Ibe2236eb4fd30faab239e7c9c8b578164014eb39 Reviewed-on: https://pdfium-review.googlesource.com/3108 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Cleanup fx_dib_composite part 2Nicolas Pena
Fix some nits, add helper methods GetAlpha and GetGray to reduce code duplication. Change-Id: I5ea7e9ae306a4fc83f861f0e65879731e680f4f8 Reviewed-on: https://pdfium-review.googlesource.com/3109 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-21Upgrade libtiff to 4.0.7.Lei Zhang
Change-Id: If3f67767f738b7f23230ca8c37c9af2e31696e82 Reviewed-on: https://pdfium-review.googlesource.com/3117 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-20Cleanup fx_dib_composite part 1: simplify lum and sat methods.chromium/3047Nicolas Pena
Change-Id: I4c00324990a62b624596110f442969a988631cb3 Reviewed-on: https://pdfium-review.googlesource.com/3105 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-20Use std::vector<std::unique_ptr<CPVT_WordInfo>> as word array.Tom Sepez
We never push nullptrs into this array, so remove some checks for nullness, but be really careful about bounds checking. Change-Id: I79960a4cc9a729b3d5985f297aea8c4b03ceb601 Reviewed-on: https://pdfium-review.googlesource.com/3103 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-20these files are being removed from skiaMike Reed
Will allow us to re-land this https://skia-review.googlesource.com/c/9891/ BUG=skia:6366 Change-Id: I8a82610309f835065487039883180b8a35733a76 Reviewed-on: https://pdfium-review.googlesource.com/3116 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-20Simplify date time codeDan Sinclair
This CL removes the CFX_DateTime class and moves the one used method into the CFX_Unitime class. Change-Id: I89f6d099b2c436d8f12b9dc2c5f10ac236ad56ef Reviewed-on: https://pdfium-review.googlesource.com/3104 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-20Cleanup unchanged values in CFX_TxtBreakDan Sinclair
This Cl cleans up some members which are always the same value. Change-Id: Ic3feeb5cd8c8a8c3de5a7d6ec3628d32efc600ef Reviewed-on: https://pdfium-review.googlesource.com/3107 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-20Allow processing fonts with indirect dictNicolas Pena
BUG=pdfium:667 Change-Id: I6e7620948086f3f620e4cde778a4144570e1bd6d Reviewed-on: https://pdfium-review.googlesource.com/3106 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-20Cleanup fgas_datetime codeDan Sinclair
This CL removes unused methods, removes default params and moves static methods into an anonymous namespace. Change-Id: I9a0d9907b46907ababbfb8730f1f6c76002d238a Reviewed-on: https://pdfium-review.googlesource.com/3091 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-17Add pdfium::clamp() as a placeholder for std::clamp().chromium/3046Lei Zhang
Ue it to fix a typo as well. BUG=pdfium:634 Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404 Reviewed-on: https://pdfium-review.googlesource.com/3113 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-17Use std::vector in CPDF_StreamContentParser.Lei Zhang
Change-Id: I2e1bc6cd8ba45fef2bde55bcc3f0c19947d46ed5 Reviewed-on: https://pdfium-review.googlesource.com/3111 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-17Bring CPDF_ICCBasedCS closer to PDF spec.Lei Zhang
The spec says the N dictionary field is required and must be set to a valid value. Adjust the code based on this assertion. BUG=pdfium:675,chromium:691967,chromium:702238 Change-Id: Iaa76fa0e16ce4aaa9822ad471668cbf8af5fb7cb Reviewed-on: https://pdfium-review.googlesource.com/3112 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-17Replace CLines class with std::vector<Cline>.Tom Sepez
m_LineArray only grows via push_back of non-null pointer, so remove some null checks. Another little idiosyncrasy is CLines::Clear() doesn't clear the items in CLines, only the things that were once in CLines but aren't anymore. So don't call it. Change-Id: Icc434be94b1b0522533c7533b8f6b2736bb864c4 Reviewed-on: https://pdfium-review.googlesource.com/3099 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-17HardClip points a bit better in fx_agg_driverNicolas Pena
In agg, the length is of type coord_type, which we have as int16. So having points bigger than the max short will not work properly. BUG=chromium:699982 Change-Id: I0e4cab6ae2b6aa023359aec4b5b3d611f8a8eb4f Reviewed-on: https://pdfium-review.googlesource.com/3101 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-17Handle web links across lineschromium/3045Wei Li
When a web link has a hyphen at the end of line, we consider it to be continued to the next line. For example, "http://www.abc.com/my-\r\ntest" should be extracted as "http://www.abc.com/my-test". BUG=pdfium:650 Change-Id: I64a93d9c66faf2be0abdaf8cfe8ee496c435d0ca Reviewed-on: https://pdfium-review.googlesource.com/3092 Commit-Queue: Wei Li <weili@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-17Coalesce redundant path points.Lei Zhang
There exists PDFs with many redundant path points, and keeping track of them all uses a lot of memory. BUG=chromium:679353 Change-Id: I514610cbba181658b6396e30f5bf58a3661359f5 Reviewed-on: https://pdfium-review.googlesource.com/3110 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-03-17Cleanup in fx_agg_driver part 2Nicolas Pena
Moved CFX_Renderer to namespace and added some private auxiliary methods to reduce duplicated code. Also, more nit cleanup (casts, brackets, etc). Change-Id: I66f36177767325068a8a9ebf04a5d9b3a1762d94 Reviewed-on: https://pdfium-review.googlesource.com/3093 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-17Make gyp a Windows-only dependency.Lei Zhang
BUG=pdfium:559 Change-Id: Id0a01bcc2de597ce2b2e3d60dd5c737af75c93ab Reviewed-on: https://pdfium-review.googlesource.com/2958 Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-03-16Introduce unique_ptr compatible deleters for FPDF typeschromium/3044Tom Sepez
Pre-requisite for easily fixing some leaks in sample code, fuzzers, etc. Kill off some types completely unused in the C API. Change-Id: I67f0a5c6eef63d8e062ca4bc97c9db03970fe337 Reviewed-on: https://pdfium-review.googlesource.com/3095 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-16Cleanup some fgas locale code.Dan Sinclair
This Cl cleans up a bit of the locale code in fgas, removing unused code and cleaning up some of the other code. Change-Id: Ieb18df552cf5d803c1bbdbfe11a4f5a88c4b3af3 Reviewed-on: https://pdfium-review.googlesource.com/3094 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-16Import PartitionAlloc from Chromium.Chris Palmer
We'll add callers in a later CL. BUG=pdfium:678 Change-Id: I98c8b2832c4750df326218e24ee8c1bd33b89b50 Reviewed-on: https://pdfium-review.googlesource.com/3066 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-16Remove some nested statements in CPDF_DataAvail.Lei Zhang
Change-Id: I959dbfebdc7a5a1ec9b201a80ff6cfdc031572b0 Reviewed-on: https://pdfium-review.googlesource.com/2833 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>