summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-10-18Traverse PDF page tree only once in CPDF_Documentchromium/2895npm
In our current implementation of CPDF_Document::GetPage, we traverse the PDF page tree until we find the index we are looking for. This is slow when we do calls GetPage(0), GetPage(1), ... since in this case the page tree will be traversed n times if there are n pages. This CL makes sure the page tree is only traversed once. Time to load the PDF from the bug below in chrome official build: Before this CL: 1 minute 40 seconds After this CL: 5 seconds BUG=chromium:638513 Review-Url: https://codereview.chromium.org/2414423002
2016-10-18Add a test case for bug 494057.thestig
The expectation is set incorrectly to allow the test to pass. BUG=chromium:494057 Review-Url: https://codereview.chromium.org/2430583002
2016-10-17Cleanup unneeded FWL theme code.dsinclair
This CL removes FWL theme code methods which do not have implementations. Review-Url: https://codereview.chromium.org/2422373002
2016-10-17FPDFPage_TransformAnnots(): don't re-insert unowned object on top of itselftsepez
Underlying cause of the bug, unmasked when CPDF_Dictionary lost a redundancy check. BUG=656162 Review-Url: https://codereview.chromium.org/2425003002
2016-10-17Fix segv in AddImage()tsepez
The assumption that only indirect objects would be passed is wrong. Restore old behaviour despite muddying ownership constraints. R=thestig@chromium.org BUG=656145 Review-Url: https://codereview.chromium.org/2425843002
2016-10-17Move fxge/android to if(is_android) on buildchromium/2894npm
core/fxge/android files all have if _FX_OS_ == _FX_ANDROID_. Instead, put the files inside if (is_android) on Build.gn. Also, the skia file is already under if (pdf_use_skia), so the if defined(_SKIA_SUPPORT_) can be removed. Review-Url: https://codereview.chromium.org/2413983004
2016-10-17Rename CFX_CountRef to CFX_SharedCopyOnWritetsepez
Avoid confusing this class with other ref-counted objects. Review-Url: https://codereview.chromium.org/2426673002
2016-10-17Revert "Make CPDF_Object containers hold objects via unique pointers."tsepez
This reverts commit 1d023881cd53485303c0fcc0b5878e700dc470fd. Reason for revert -- fuzzers hit issues. TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2425783002
2016-10-17lcms: Revise previous cmsStageAllocMatrix fixkcwu
Also fixed wrong patch file name. This is fixup of 958e57cb and d2023170 TEST=apply this change in lcms' repo and make check BUG=chromium:651849,chromium:654198 Review-Url: https://codereview.chromium.org/2424803002
2016-10-17lcms: reject NaN when reading float numberskcwu
LerpFloat functions expect input values are normal float. They first clamp values to the range of [0.0, 1.0] and then calculate interpolation with the input values. If the input value is NaN, it will lead to heap buffer overflow because the index to LutTable is calculated based on the said value and fclamp(NaN) is not in expected [0.0, 1.0] range. This patch rejects all NaN values earlier when reading float numbers. So it also changed behavior for cases other than LerpFloat. I think it is okay because NaN doesn't make sense for usual calculations. BUG=654676 Review-Url: https://codereview.chromium.org/2422553002
2016-10-17Strengthen bounds check in CWeightTable::Calc * part IIstackexploit
This CL implemented a better version of CWeightTable::GetPixelWeightSize(), which will calculate the size of array PixelWeight.m_Weights correctly to prevent potential heap buffer overflow conditions. BUG=chromium:654183 R=ochang@chromium.org, thestig@chromium.org, dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2404453003
2016-10-15Fix some nits in cpdf_annotlist.cpp.thestig
Review-Url: https://codereview.chromium.org/2395693002
2016-10-14Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."Tom Sepez
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
2016-10-14Ready to enable MSan build for PDFiumchromium/2891weili
Add all the necessary files used for MSan build and run. BUG=pdfium:1 Review-Url: https://codereview.chromium.org/2384353002
2016-10-14Update CPDF_IndirectObjectHolder APIs for unique objects.tsepez
Doing so highlights a few places where ownership is dubious. Add convenience functions to return an unowned reference to a newly-created indirect object. Review-Url: https://codereview.chromium.org/2419173002
2016-10-13Make CPDF_Object containers hold objects via unique pointers.tsepez
This tweaks the implementation while leaving the API the same. The API change is more disruptive, so break this part off first. Review-Url: https://codereview.chromium.org/2385293002
2016-10-13Optimize roll operator in CPDF_PSEngine some more.thestig
Also move code that belongs in an anonymous namespace into one. Review-Url: https://codereview.chromium.org/2416703002
2016-10-13Make CPDF_Image() constructors saner.chromium/2890tsepez
Introduce the UniqueDictionary typedef and friends, to allow moving to unique_ptrs before the Release() deleter issue is fully resolved. This will go away down the road. Review-Url: https://codereview.chromium.org/2420743002
2016-10-13Fix nullptr crash inXFA_FFBarcode::UpdateWidgetProperty().thestig
BUG=chromium:655455 Review-Url: https://codereview.chromium.org/2421633002
2016-10-13Revert of Reland: Make the CPDFXFA_App non-global (patchset #2 id:20001 of ↵dsinclair
https://codereview.chromium.org/2418653003/ ) Reason for revert: https://build.chromium.org/p/client.pdfium/builders/linux_xfa_asan_lsan/builds/117/steps/corpus%20tests/logs/stdio Original issue's description: > Reland: Make the CPDFXFA_App non-global > > This reverts commit b685e6471075bebd26711bc183de3128f54932e3. > > This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects. > > BUG=pdfium:623 > > Committed: https://pdfium.googlesource.com/pdfium/+/f3736bca5f874b0889c5906ffbd74a405089f671 TBR=tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2414883006
2016-10-13Reland: Make the CPDFXFA_App non-globaldsinclair
This reverts commit b685e6471075bebd26711bc183de3128f54932e3. This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects. BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2418653003
2016-10-13Put CPDF_StreamContentParser into its own .cpp/.h filestsepez
No functional changes. Make many of its methods private. Review-Url: https://codereview.chromium.org/2415943003
2016-10-13Clean up fx_basic_util a littlenpm
- Nit fixes. - Remove unused methods. - Replace FX_BOOL with bool. Review-Url: https://codereview.chromium.org/2419433004
2016-10-13Remove duplicate FWL key flagsdsinclair
The FWL key flags exist in two places, with different values between them. This CL combines them to be in a single location. Review-Url: https://codereview.chromium.org/2415743003
2016-10-13Revert of Make the CPDFXFA_App non-global (patchset #3 id:80001 of ↵dsinclair
https://codereview.chromium.org/2416753002/ ) Reason for revert: https://build.chromium.org/p/client.pdfium/builders/linux_xfa_asan_lsan/builds/112/steps/embeddertests/logs/stdio msan is sad. Original issue's description: > Make the CPDFXFA_App non-global > > This CL changes CPDFXFA_App from a global object to a child of the > CPDFXFA_Document objects. > > BUG=pdfium:623 > > Committed: https://pdfium.googlesource.com/pdfium/+/abefb79577b32d291d14d7e01a70f6f8cf213bd3 TBR=tsepez@chromium.org,thestig@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2412903004
2016-10-13Make the CPDFXFA_App non-globaldsinclair
This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects. BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2416753002
2016-10-13split CPDF_StreamContentParser::AddImage() into 3 overloads.tsepez
Small step before making CPDF_Image stream ownership saner. Review-Url: https://codereview.chromium.org/2416733002
2016-10-13Verify number of ex flags matches number of ex items.dsinclair
Currently the JBig2 decoder can leak subimages in the case where we mark more items in EXFLAGS then we have SDNUMEXSYMS. This Cl checks for this condition and fails the decode if it happens. BUG=chromium:654365 Review-Url: https://codereview.chromium.org/2419553002
2016-10-13Cleanup CPDFXFA_App methodsdsinclair
This CL removes methods which are never called, or are only called once and return a static value. Those values are inlined at the calling site. Review-Url: https://codereview.chromium.org/2418633002
2016-10-13Reduce missing evt file spam in pdfium_test.thestig
Review-Url: https://codereview.chromium.org/2415663003
2016-10-12Cleanup nits from merge CLchromium/2889dsinclair
This CL cleans up the nits from https://codereview.chromium.org/2410893002/. Review-Url: https://codereview.chromium.org/2417633002
2016-10-12added SkSL to Skia buildethannicholas
This fixes a pfdium build error when using the Skia backend, due to new Skia files which are not being properly included in the pdfium build. Review-Url: https://codereview.chromium.org/2403863002
2016-10-12Convert from int to float values.dsinclair
The CPDF_Page::GetDisplayMatrix expects to set float values into the |display_matrix| but all of the input values are currently int. It is possible to overflow the int values, so this CL changes the variables to be int which closer reflects what they're being used for. BUG=chromium:652038 Review-Url: https://codereview.chromium.org/2412983002
2016-10-12Cleanup env variable namesdsinclair
This CL cleans up any old m_pEnv variables to be correctly named m_pFormFillEnv. Review-Url: https://codereview.chromium.org/2412523002
2016-10-12Merge CPDFSDK_Document into CPDFSDK_FormFillEnvironmentdsinclair
This CL merges the CPDFSDK_Document and CPDFSDK_FormFillEnvironment classes as they always existed and always pointed at each other. Review-Url: https://codereview.chromium.org/2410893002
2016-10-12Reduce code duplication in CPDF_Type1Font::LoadGlyphMapnpm
Added methods SetExtGID and CalcExtGID for this purpose. Changed protected to private: no one inherits CPDF_Type1Font. Review-Url: https://codereview.chromium.org/2412483006
2016-10-12Check for more undefined behavior in CPDF_PSEngine.thestig
BUG=chromium:639792 Review-Url: https://codereview.chromium.org/2415483002
2016-10-12Get rid of CFX_ArrayTemplate<CPDF_Object*>tsepez
They won't work with std::unique_ptr down the road, so replace with std::vector. Review-Url: https://codereview.chromium.org/2411703003
2016-10-12Optimize roll operator in CPDF_PSEngine.thestig
Rolling 0 times is a no-op. Rolling 0 items is a no-op. Rolling N items J times is the same as rolling N items J % N times. This also avoids an integer overflow corner case. BUG=chromium:648077 Review-Url: https://codereview.chromium.org/2412833002
2016-10-12Remove unused widget handler overridesdsinclair
This CL removes override points from the widget hander classes. Review-Url: https://codereview.chromium.org/2410193005
2016-10-12Fix else-line corrupted by non-ascii character when importkcwu
BUG=pdfium:619 Review-Url: https://codereview.chromium.org/2411123003
2016-10-11Delete unused flags from CFX_SubstFontchromium/2888npm
Review-Url: https://codereview.chromium.org/2409173003
2016-10-11Fixup formfiller cleanupdsinclair
The CFFL_InteractiveFormFiller must be cleaned up before the environment because the destruction of the formfiller will trigger the destruction of the formfiller widgets. Some of those widgets may require stopping timers, which requires accessing the environment. BUG=chromium:654272, chromium:653459 Review-Url: https://codereview.chromium.org/2408163003
2016-10-11Remove remaining CPDFSDK_Document referencesdsinclair
Review-Url: https://codereview.chromium.org/2399213002
2016-10-11Convert CPDFXFA_Document to use CPDFSDK_FormFillEnvironmentdsinclair
This CL removes the use of CPDFSDK_Document from CPDFXFA_Document. Review-Url: https://codereview.chromium.org/2396213002
2016-10-11Add CPDF_Object::IsInline()tsepez
Prevent having to remember what an object number of 0 implies. Review-Url: https://codereview.chromium.org/2412673002
2016-10-11Deleted unused members in CTTFontDescnpm
Review-Url: https://codereview.chromium.org/2408213002
2016-10-11Convert fpdfformfill to use CPDFSDK_FormFillEnvironmentdsinclair
This CL converts to using CPDFSDK_FormFillEnvironment instead of CPDFSDK_Document internally. Review-Url: https://codereview.chromium.org/2398253002
2016-10-11Convert CPDFSDK_ActionHandler to CPDFSDK_FormFillEnvironmentdsinclair
This CL replaces CPDFSDK_Document with CPDFSDK_FormFillEnvironment in CPDFSDK_ActionHandler. Review-Url: https://codereview.chromium.org/2397933003
2016-10-11Convert IJS_Runtime to CPDFSDK_FormFillEnvironmentdsinclair
This CL changes the use of CPDFSDK_Document to CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2394313002