summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-16More more CPVT_GenerateAP methods to anonymous namespacechromium/3242Dan Sinclair
The Edit, Border and Color generation methods are only used in the CPVT_GenerateAP file. This CL moves them to the anonymous namespace. Change-Id: I2a5805edddd1ffb5616608054111e08e0b3f8e6f Reviewed-on: https://pdfium-review.googlesource.com/16110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-16Cleanup CPVT_GenerateAPDan Sinclair
This CL moves FPDF_GenerateAP into the anonymous namespace of CPDF_AnnotList. Several methods are moved into the anonymous namespace of CPVT_GenerateAP which are only used internally. Change-Id: I6e8fef54ba3757cc9873ed5ac370dec7eaca5d8b Reviewed-on: https://pdfium-review.googlesource.com/16070 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-16add codec to header search pathMike Reed
unblocks skia roller, as now some core .cpp files need access to SkCodec.h Bug: Change-Id: I0e1375bd167fffbf48b2b27632b213c2e009a868 Reviewed-on: https://pdfium-review.googlesource.com/16090 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-16Add FPDFCatalog_IsTagged to public API.Henrique Nakashima
The new fpdf_catalog.h will contains functions to access entries in the catalog (root) dict in a PDF. Bug: chromium:768986 Change-Id: I6e1d4a479d6f8742981e89f07bab98ee96dc3763 Reviewed-on: https://pdfium-review.googlesource.com/15970 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-10-16Hide CPVT_Dash in CPVT_GenerateAPDan Sinclair
The CPVT_Dash struct is only used in CPVT_GenerateAP. This CL moves the struct definition into the cpp class and removes the cpvt_dash.h file. Change-Id: I0f0c9279ded1086d47e81f1057d51121d9466974 Reviewed-on: https://pdfium-review.googlesource.com/16050 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-16Convert CPVT_Color to CFX_ColorDan Sinclair
This CL converts the use of CPVT_Color to CFX_Color and removes the CPVT_Color class. Change-Id: I86a2d06524cd8f0fbce2335f0185426cc41dbe84 Reviewed-on: https://pdfium-review.googlesource.com/16030 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-16Move HasXFAField out from XFA feature flagRyan Harrison
Moves the PDFium API method FPDF_HasXFAField out from behind the XFA feature flag so that XFA metrics can be generated without enabling the entire feature. Changes some of the constant names to be more accurate. BUG=pdfium:917 Change-Id: I6d8fe9fd88d392d028de2504d39d978de4a1d5b7 Reviewed-on: https://pdfium-review.googlesource.com/15990 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-10-12Remove Rietveld CQ config.chromium/3241chromium/3240Andrii Shyshkalov
Rietveld CQ has already been disabled and is no longer supoorted. TBR=thestig@chromium.org No-Try: True Bug: chromium:770592 Change-Id: I63b10470a2b5635dc1e182ec13618fcf2fdb8c74 Reviewed-on: https://pdfium-review.googlesource.com/15950 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-10-12Add more checks to fseeks in CFX_FolderFontInfoNicolas Pena
Bug: chromium:770890 Change-Id: Iee532d76aabc0763a835c203344455ba07c6e82c Reviewed-on: https://pdfium-review.googlesource.com/15930 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-10-10Fix dangling pointer to ID array in CPDF_SecurityHandler.chromium/3238chromium/3237Henrique Nakashima
This was caused by breaking the reference from CPDF_SecurityHandler to CPDF_Parser in https://pdfium-review.googlesource.com/c/pdfium/+/15290 The reference was replaced with a reference to the ID Array and a copy of the password. The issue is that when parsing PDFs with multiple trailers, the trailer containing the ID array may be replaced and destroyed in CPDF_Parser::TrailerData::SetMainTrailer() after being passed to CPDF_SecurityHandler, which would then have a dangling pointer to it. This CL changes the CPDF_SecurityHandler to hold a copy of the original file ID instead of all the ID Array. Bug: chromium:771479,chromium:772376 Change-Id: Id98100502093d890fc2fe6a3da139f910daf38f4 Reviewed-on: https://pdfium-review.googlesource.com/15910 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-10-10Fix UAF in SaveData on all of CFFL_* types.Luật Nguyễn
Bug: 756427 Change-Id: I8e31d96c6f3b83a6464ed69c95225362c50386d1 Reviewed-on: https://pdfium-review.googlesource.com/15870 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-10Fix crash when offset > file_size_ in cpdf_read_validator.cpp.Henrique Nakashima
Reinstating a check that was lost in https://pdfium-review.googlesource.com/c/pdfium/+/15270 Change-Id: Ic0a7fee71aff605127d7e3789cc54b7ddfb9e399 Reviewed-on: https://pdfium-review.googlesource.com/15631 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-06Fix a crash in CPDF_ImageRenderer.chromium/3236chromium/3235Lei Zhang
BUG=chromium:770884 Change-Id: Ia609db04b0e596649fbda087290b7da040211f14 Reviewed-on: https://pdfium-review.googlesource.com/15790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-10-05Remove CPVT_SectionInfoDan Sinclair
The CPVT_SectionInfo class only contains a CPVT_FloatRect member. This CL removes the usage of CPVT_SectionInfo and uses the CPVT_FloatRect where needed instead. Change-Id: Ica020466db03282cf2ad9a7051899d74f8aef076 Reviewed-on: https://pdfium-review.googlesource.com/15730 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-10-05Remove unused CPVT_SectionInfo::nTotalLinesDan Sinclair
The nTotalLines member is set but never used. Removed. Change-Id: Iab59e0954fcdbab665cc477397a94cde66e6087e Reviewed-on: https://pdfium-review.googlesource.com/15710 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove CPVT_SectionDan Sinclair
The CPVT_Section only contained a single rect which was used in one place. The place it was used never used the variable it assigned it too. Removed. Change-Id: I5c3fccff4fad6deca4945e301bffb5348692b23c Reviewed-on: https://pdfium-review.googlesource.com/15675 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove unused methods from CPDF_VariableText::Iterator.Dan Sinclair
This CL removes methods from CPDF_VariableText::Iterator which are never called. Change-Id: I8652320f0e6576e39e7636ce9941e1f148eb9cec Reviewed-on: https://pdfium-review.googlesource.com/15674 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove CPVT_WordPlace from CPVT_SectionDan Sinclair
Parameter was set but never used. Removed. Change-Id: I4bbda0ef7a94e156092e7ac10ae6b9a6fd6713e7 Reviewed-on: https://pdfium-review.googlesource.com/15673 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove CPVT_WordPropsDan Sinclair
Only one of the props was being used and that prop always had the same value. This CL removes CPVT_WordProps. Change-Id: I8cf64f0e9b80c5af18b8fc40ef7b602ffeec7f93 Reviewed-on: https://pdfium-review.googlesource.com/15672 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove unused CPVT_SecPropschromium/3234Dan Sinclair
The CPVT_SecProps were assigned but never accessed. Removed. Change-Id: I2ed15f44dc7a428261e729fc7a835885257d4807 Reviewed-on: https://pdfium-review.googlesource.com/15671 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove more unused paramsDan Sinclair
Remove some unused parameters in cpwl_edit_impl.cpp Change-Id: Ie56775ef671ae03b2b53a01cc2539683585a1c68 Reviewed-on: https://pdfium-review.googlesource.com/15690 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove unused parametersDan Sinclair
Remove unused params from CPDF_VariableText methods. Change-Id: Ia02f99ea84f0c29e9f674a2cb837b422de390d33 Reviewed-on: https://pdfium-review.googlesource.com/15670 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Add ObservedPtr to catch Widget being killed by JSRyan Harrison
Another case of a call causing JS to run, which can remove a widget that is called later. BUG=chromium:771979 Change-Id: I5f25a38097662b70cfb777f76f0e3d50e7c11b1b Reviewed-on: https://pdfium-review.googlesource.com/15610 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-10-05Add ObservedPtrs to catch issues in SaveDataRyan Harrison
BUG=chromium:756427 Change-Id: I90c7065ec5a467cb954cdf3e1d6954a0b0655d4e Reviewed-on: https://pdfium-review.googlesource.com/15630 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-10-05Create FreeType roll scriptNicolas Pena
Change-Id: Ie93f74b683d35e859cc0e3a1dd5899fb073d8864 Reviewed-on: https://pdfium-review.googlesource.com/15570 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-10-05Make GIF decoder more standards complaintRyan Harrison
Fixed issue with unit tests that was causing raw data to be backwards and reverted related LSB -> MSB change that was introduced due to this. If global palette not set then the background colour index should be 0. Check that background colour index is valid when global palette exists. Check if transparency index is valid for the palette of the frame it is being applied to. BUG=chromium:770337 Change-Id: I5d9b648f45bbb4c93218664a7035e4d01dbeb627 Reviewed-on: https://pdfium-review.googlesource.com/15453 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-05Move CPDF_RenderOptions members to privateDan Sinclair
This CL moves the members of CPDF_RenderOptions to be private members and adds accessor methods as needed. Change-Id: Ie91665ff53ae00cc4c53741d089d375503fabe11 Reviewed-on: https://pdfium-review.googlesource.com/15531 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove friend from CPDF_ApSettingsDan Sinclair
This CL removes the friend class from CPDF_ApSettings and makes the needed methods public. Change-Id: I062004d619676b31648f49c9d18a8595874e3c57 Reviewed-on: https://pdfium-review.googlesource.com/15532 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Roll FT to ae7dc1f62d826083d418e86cce3f66a76dff038aNicolas Pena
List of changes: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/7e50824288fa..ae7dc1f62d82 Bug: chromium:754574 pdfium:905 Change-Id: Ic7525eb5a4d5fab19bdc2ec7e625e0fc889c52a2 Reviewed-on: https://pdfium-review.googlesource.com/15370 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-10-05Remove friends from form codeDan Sinclair
This CL removes the friends from CPDF_FormControl and CPDF_InterForm and adds accessors and moves methods to public as needed. Change-Id: I9d18c9158b1499ca935964b5f9dbd937f0806163 Reviewed-on: https://pdfium-review.googlesource.com/15533 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove friends from CPDF_VariableTextDan Sinclair
This CL removes the friend class items from CPDF_VariableText and adds accessor and makes methods public as needed. Change-Id: Ic54732b25e9879c39a2276a89580cf42d3b3947f Reviewed-on: https://pdfium-review.googlesource.com/15534 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Cleanup CPDF_RenderStatusDan Sinclair
This CL removes friend classes and moves public members to be private in the CPDF_RenderStatus class. Change-Id: Icdd6291bb8c1e5f43386d4a939b1eeaa16b8886d Reviewed-on: https://pdfium-review.googlesource.com/15530 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove CPDF_Object friendsDan Sinclair
This CL removes the friends from CPDF_Object and adds accessors as needed. The m_GenNum was moved to a private member as none of the overriding classes needed access. Change-Id: If23a1a6752dea31eb80669a36694973f3c581123 Reviewed-on: https://pdfium-review.googlesource.com/15470 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove friends from CXML_ElementDan Sinclair
This CL removes the friends from CXML_Element and adds accessors as needed. Change-Id: I4f76935caa753a063bef4ff2d043273ae4e14e14 Reviewed-on: https://pdfium-review.googlesource.com/15535 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Remove CPDF_CMapParser friendsDan Sinclair
This CL removes the friends from CPDF_CMapParser. The two needed methods have been moved from private statics to public methods on the class. Change-Id: Ida76aa8748435e089874d9ef9c6545527b175561 Reviewed-on: https://pdfium-review.googlesource.com/15454 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-05Fix Null-dereference READ in CPDF_Dictionary::GetIntegerFor.Artem Strygin
Bug: chromium:771858 Change-Id: Ief40de384921f943a40e8154b67d83ae6e7ed915 Reviewed-on: https://pdfium-review.googlesource.com/15490 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-10-04Remove friends from CPDF_TextObjectchromium/3233Dan Sinclair
This CL removes the friends from CPDF_TextObject and adds accessor methods as needed. Change-Id: I68d18297640b46113df79f58bea50b77dac89d39 Reviewed-on: https://pdfium-review.googlesource.com/15455 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-04Remove CPDF_CMap friendsDan Sinclair
This CL removes the friends from CPDF_CMap and adds accessors for the needed items. Change-Id: Icf7b3e639c0904209f7db80c9460146cd29dd78a Reviewed-on: https://pdfium-review.googlesource.com/15452 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-10-04Make CPDF_TransferFunc members privateDan Sinclair
This CL moves the member variables of CPDF_TransferFunc to be private from public and adds accessors as needed. Change-Id: Ib5158721bbe833727b333da794d774f17e4fdea7 Reviewed-on: https://pdfium-review.googlesource.com/15451 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-04Explicitly return std::vector in CFDE_TextEditEngine.Lei Zhang
Some build configurations do not like the {} variant. Change-Id: I32f5a18e5b41b628d6b45ec5eb9b26eded5b7d9c Reviewed-on: https://pdfium-review.googlesource.com/15450 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-10-04Make CPDF_FontGlobals members privateDan Sinclair
This CL makes the embedded maps and the cmap manager private to CPDF_FontGlobals and adds accessor methods as needed. Change-Id: I50350fcfad5428defe5e68d9d3b29e8961e66e9f Reviewed-on: https://pdfium-review.googlesource.com/15412 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-10-04Remove CFX_CRTFileAccessDan Sinclair
The CFX_CRTFileAccess class was only used in one place and only provided one method. That method was folded back into the caller and the class removed. Change-Id: I5e670474244a9ec037b6d099d67bd5091cac7ff4 Reviewed-on: https://pdfium-review.googlesource.com/15410 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-04Fix Heap-use-after-free in CPDF_SecurityHandler::~CPDF_SecurityHandler.Artem Strygin
The CPDF_SecurityHandler contains unowned reference to "ID" array, which is owned by main trailer. Main trailer is owned by CPDF_Parser::m_TrailerData To fix this issue set m_TrailerData before m_pSecurityHandler(CPDF_SecurityHandler) in CPDF_Parser members list. Bug: chromium:771479 Change-Id: I38413ba16b1454ac775c8a07b126fa3b86714c1b Reviewed-on: https://pdfium-review.googlesource.com/15430 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-10-04Improve readability for CPDF_LinearizedHeader.Artem Strygin
Change-Id: Ic564139cd8b14d2a8a2a5b4a70251b398753e50f Reviewed-on: https://pdfium-review.googlesource.com/13830 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-04Fix UAF in SetVisible().Henrique Nakashima
SetVisible() may be called during Destroy() which may be called during SetVisible(). This fixes the latest in a family of bugs that happen after an instance is freed by code triggered by JS code while it's executing a method. The CL has a lot of protection for many of these points where JS may be executed and potentially destroy objects. The return types of many methods that may execute JS have been changed to bool, indicating whether the instance is still alive after the call. Bug: chromium:770148 Change-Id: If5a9db4d8d6aac10f4dd6b645922bb96c116684d Reviewed-on: https://pdfium-review.googlesource.com/15190 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-10-04Unify parsing of cross ref table v4.Artem Strygin
We can use 'Prev' value of first-page cross-reference table trailer for load main cross-reference table, instead of 'T' value of Linearized header (Offset of first entry in main cross-reference table). This is better solution, because this is allow us check entry count in main cross-ref table and unify loading of main cross-ref table with loading methods of non linearized document. See PDF specification: http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf#678 (page 678, Example 3/part 3) Change-Id: I59dcf3c73a0fb561221ded78e827e40535dbd717 Reviewed-on: https://pdfium-review.googlesource.com/13810 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-04Simplify CPDF_DataAvail::ParseIndirectObjectAtArtem Strygin
Change-Id: I072df58730f323bb5d77d180382ea209cf47f930 Reviewed-on: https://pdfium-review.googlesource.com/13832 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-10-03Unify CPDF_HintsTable.chromium/3232Artem Strygin
Break relationship from CPDF_DataAvail for CPDF_HintsTable. Change-Id: If3e6d4910dd368742f095c05adb122ab08c0d804 Reviewed-on: https://pdfium-review.googlesource.com/15270 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-03Improve CPDF_SecurityHandler code style.Artem Strygin
Make m_pEncryptDict as constant value. Change-Id: I4f65578e936eae5bd6afe9bfed20da3ab8e20de3 Reviewed-on: https://pdfium-review.googlesource.com/15350 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-10-03Simplify CPDF_Parser::GetIDArrayArtem Strygin
Change-Id: Idbd205edcf7400ffc46edf4d9f09be6ace6d0e7f Reviewed-on: https://pdfium-review.googlesource.com/13734 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>