summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-31Attempt to fix potential integer overflow in CFX_FaceCache::LoadGlyphPath().chromium/2846thestig
BUG=641333 Review-Url: https://codereview.chromium.org/2294183002
2016-08-31Use CheckedNumeric for strength calculation.dsinclair
Update the calculation of the outlines bold strength to use a CheckedNum instead of an int. BUG=chromium:639506 Review-Url: https://codereview.chromium.org/2296193002
2016-08-31Move maxNumDataBytes and maxNumEcBytes calculation to fix crashnpm
The blocks.Add will std::move the unique_ptrs, so the std::max calculations need to go before. Without this change, pdfium_test will crash when trying to render test/barcode_test.pdf with XFA enabled. Tested that after this change, barcode_test.pdf is rendered without crashing. Review-Url: https://codereview.chromium.org/2298833002
2016-08-31Make CPDF_ColorState have a CFX_ColorStateData rather than inheritingtsepez
Review-Url: https://codereview.chromium.org/2294133002
2016-08-31Make CPDF_GraphState have a CPDF_GraphStateData instead of inheriting.tsepez
Get callers out of the copy-before-write business, and let the class manage it instead. Review-Url: https://codereview.chromium.org/2292363002
2016-08-31Update gn args in README so it includes is_component_buildnpm
Added is_component_build = false and brief explanation Review-Url: https://codereview.chromium.org/2301543002
2016-08-31Use enum class for subtypes of CPDF_Annot.jaepark
Comparing CFX_ByteString for annotation subtypes is inefficient and error-prone. This CL uses enum class to compare annotation subtypes. Also, remove unused IPDFSDK_AnnotHandler::GetType() and FSDK_XFAWIDGET_TYPENAME. Review-Url: https://codereview.chromium.org/2295953002
2016-08-31Free the GifPlainText object when complete.dsinclair
We allocate the GifPlainText object on line ~685 inside GIF_D_STATUS_EXT_PTE. We cleanup the internal pointers in the gif_destroy_decompress() but we failed to cleanup the pointer itself. This CL frees the allocated pointer once the data is cleaned up. BUG=chromium:638499 Review-Url: https://codereview.chromium.org/2291143003
2016-08-30Update .gitignore to properly ignore base/thestig
TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2298603003
2016-08-30Fix ASAN build after rolling DEPS for build/thestig
TBR=dpranke@chromium.org Review-Url: https://codereview.chromium.org/2297133002
2016-08-30Roll DEPS for build to b73bafdd.thestig
Also roll: buildtools to adb8bf4e. skia to 3ee255f2. v8 to 3d96d7ee. And make tweaks to get it all working. Review-Url: https://codereview.chromium.org/2283883002
2016-08-30Clean up CPDF_CMap declarationchromium/2845npm
- Removed unused methods - Friendship with CPDF_PathManager is not needed - Protected may be changed to private Review-Url: https://codereview.chromium.org/2292023003
2016-08-30Rename CPDFSDK_BFAnnotHandler and CPDFSDK_XFAAnnotHandler.jaepark
CPDFSDK_BFAnnotHandler handles CPDFSDK_Widget, so rename it to CPDFSDK_WidgetHandler. Similarly, CPDFSDK_XFAAnnotHandler handles CPDFSDK_XFAWidget, so rename it to CPDFSDK_XFAWidgetHandler. Review-Url: https://codereview.chromium.org/2298443002
2016-08-30Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one.tsepez
Review-Url: https://codereview.chromium.org/2287313004
2016-08-30Guard against overflow when calculating font weight.dsinclair
This CL uses the safe math libraries when calculating the font weight from the StemV value as very large values for StemV can cause the signed int to overflow. BUG=chromium:641418 Review-Url: https://codereview.chromium.org/2293633002
2016-08-30Ignore the base/trace_event directorydsinclair
TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2296743002
2016-08-30Fix missing files found by gn gen --check.thestig
Move trace_events DEPS from v8/base/ to base/ Review-Url: https://codereview.chromium.org/2292553003
2016-08-30More better const-ness in CFX_CountRef<>tsepez
There are a couple of places where code is calling GetObject() that should be calling GetPrivateCopy(), but works because the value may not be shared at the time. This just makes it safer. Review-Url: https://codereview.chromium.org/2290863002
2016-08-29Display content of the annotation when mouse hover.jaepark
Each annotation has its contents, and users should be able to see the contents. In this patch, PDFium creates a Popup annotation for each annotation and stores the author and the content. When a user mouse hover on the annotation, PDFium draws the corresponding Popup annotation and displays the content. Also, roll DEPS for testing/corpus to 5867fa6. BUG=62625 Review-Url: https://codereview.chromium.org/2273893002
2016-08-29Skip the channel if there is no data.dsinclair
The JPX decoder needs to verify there is data associated with an image channel before access. This was already done in one side of the if() but seems to be missing from the other. This Cl updates the loop to check the existance of channel data and to continue iteration if none found. BUG=chromium:637232 Review-Url: https://codereview.chromium.org/2291813002
2016-08-29Revert "Add -> operators to CFX_CountRef."tsepez
This reverts commit c10c23a2b1999b1cb0354fd4db9837dc63a3d833. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2285283003
2016-08-29Revert "Replace wrapper methods in CPDF_Path with -> operator."tsepez
This reverts commit d09a09751f724ecdb1a0bc307447a3d0c212ebff. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2291833002
2016-08-29Revert "Use ->() in CPDF_ColorState"tsepez
This reverts commit 91ddd3f7501429222f648b986a99f3959a398889. Reason for revert: may introduce sublte bugs, more thought required. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2294553002
2016-08-29Fix for #618267. Adding a method to determine if multiplication hastracy_jiang
overflow. BUG=618267 Review-Url: https://codereview.chromium.org/2284063002
2016-08-29Verify element exists before accessing.dsinclair
Currently when the parser utility classes are outputting to a text buffer we do not verify that an element from an array exists before accessing. We can have null items in arrays (and dictionaries but the dictionary case is already handled). This Cl updates the code to check the element exists before attempting to use the element. BUG=chromium:641076 Review-Url: https://codereview.chromium.org/2292473004
2016-08-29Use ->() in CPDF_ColorStatetsepez
Move methods to CPDF_ColorStateData. Move MakePrivateCopy() methods to call sites. Remove now-empty cpdf_colorstate.cpp file. Review-Url: https://codereview.chromium.org/2291763002
2016-08-29openjpeg: Prevent an integer overflow in opj_jp2_apply_pclr.stackexploit
This patch also prevent a null pointer access problem. BUG=chromium:638829 R=ochang@chromium.org Review-Url: https://codereview.chromium.org/2270343002
2016-08-29Initialize the CPDF_Document pointerdsinclair
This CL is a speculative fix for the associated BUG. Make sure the CPDF_Document is initialized in the constructor. BUG=chromium:640998 Review-Url: https://codereview.chromium.org/2291743002
2016-08-29Replace wrapper methods in CPDF_Path with -> operator.tsepez
These just invoked exaclty the same methodes in the underlying xxxData class, which we can now do with just a ->() Move some methods to the xxxData class, where they belong. In doing so, put MakePrivateCopy() calls at each callsite for those methods that made a copy. Review-Url: https://codereview.chromium.org/2286983002
2016-08-29Add some limit checks to ReadSharedObjHintTable().thestig
BUG=641444 Review-Url: https://codereview.chromium.org/2283893003
2016-08-29Move CFX_SubstFont and CTTFontDesc into their own filesnpm
Review-Url: https://codereview.chromium.org/2292503002
2016-08-29Fix the test case added in https://codereview.chromium.org/2277063003/tonikitoo
In [1], it was made a mistake in the way the test case testing/resources/pixel/bug_492.pdf was generated. This CL aims at fixing this mistake by: 1- keep making use of the new pdfium_test capability introduced by [1], 2- add a proper .in file for the test case to generate its respective .pdf file. [1] https://codereview.chromium.org/2277063003/ BUG=pdfium:492 Review-Url: https://codereview.chromium.org/2286023002
2016-08-27[Android] Make Android CQ bot non-experimental.chromium/2844chromium/2843jbudorick
BUG=pdfium:416 Review-Url: https://codereview.chromium.org/2283313002
2016-08-26Add -> operators to CFX_CountRef.chromium/2842tsepez
Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002
2016-08-26Rename CPDFSDK_Annot::GetType to CPDFSDK_Annot::GetAnnotSubtype.jaepark
CPDFSDK_Annot::GetType should be renamed to GetAnnotSubtype as it returns annotation subtype. Also, CPDFSDK_Annot::GetSubType is only used to check if the annotation is signature widget. Thus, change the method to IsSignatureWidget. Lastly, rename CPDF_Annot::GetSubType to CPDF_Annot::GetSubtype to match with spec. Review-Url: https://codereview.chromium.org/2287703002
2016-08-26Make CFX_CountRef<>::m_pObject private, add accessors, fix const-ness.tsepez
Hide the CountedObj class from the rest of the code. Rename GetModify() to GetPrivateCopy(), since it turns out there are places where we modify a potentially-shared copy. Add non-const version of GetObject() to permit these. Review-Url: https://codereview.chromium.org/2287633002
2016-08-26Remove CFX_CountRef::IsNull in favor of operator booltsepez
Review-Url: https://codereview.chromium.org/2285513002
2016-08-26Add support to Document::getAnnots methodtonikitoo
Although notably, the parameters handling support is not complete, CL intends to be the first step towards a more complete implementation of this API. TEST=testing/resources/javascript/bug_492_1.in BUG=pdfium:492 Review-Url: https://codereview.chromium.org/2281273002
2016-08-26Remove most things GYP.thestig
BUG=pdfium:559 Review-Url: https://codereview.chromium.org/2286653002
2016-08-26build_gyp: Remove deprecated flag, which is enabled by default.vmpstr
This patch removes check-implicit-copy-ctors flag to the clang plugins. This flag is enabled by default and will be removed soon. R=thestig@chromium.org Review-Url: https://codereview.chromium.org/2283923002
2016-08-26Revert "Remove the document tagged code as it is unused."npm
The code that was deleted is being used by Android foxit viewer This reverts commit dbfc3522a6ee24d17f2c50a5dcc465db52a280ee and updates the #includes Review-Url: https://codereview.chromium.org/2281083002
2016-08-26Rework CFX_CountRef in terms of CFX_RetainPtr.tsepez
Make use of existing ref count work rather than re-inventing it. Review-Url: https://codereview.chromium.org/2281683002
2016-08-26Move the classes in fpdf_text_int.cpp into their own filesnpm
- CPDF_TextPageFind and CPDF_LinkExtract moved to new file - fpdf_text_int.cpp renamed to be CPDF_TextPage definition Review-Url: https://codereview.chromium.org/2286723003
2016-08-26Roll DEPS for skia to 3bf7509c.thestig
TBR=caryclark@google.com Review-Url: https://codereview.chromium.org/2287443002
2016-08-26Roll DEPS for icu to 2341038b.thestig
TBR=jshin@chromium.org Review-Url: https://codereview.chromium.org/2283723002
2016-08-26Roll DEPS for clang to 797371be.thestig
TBR=thakis@chromium.org Review-Url: https://codereview.chromium.org/2282693002
2016-08-26Extend pdfium_test capability so that more Javascript can be executedchromium/2841tonikitoo
In [1], the lack of support of pdfium_test to some application level hooks was felt. More specifically, the lack of implementation of the hook FFI_GetPage, called when 'this.getAnnot()' is executed in an Acrobar JS context, makes it non-trivial to JS texts that manipulate PDF annotations. [1] https://codereview.chromium.org/2265313002/ Here is the failing call stack in pdfium_test: 0 ::RenderPdf (samples/pdfium_test.cc) 1 ::FORM_DoDocumentOpenAction (fpdfsdk/fpdfformfill.cpp) 2 CPDFSDK_Document::ProcOpenAction (fpdfsdk/fsdk_mgr.cpp) 3 CPDFSDK_ActionHandler::DoAction_DocOpen (fpdfsdk/fsdk_actionhandler.cpp) <----v8----> 4 Document::getAnnot (fpdfsdk/javascript/Document.cpp) 5 CPDFSDK_Document::GetPageView (fpdfsdk/fsdk_mgr.cpp) 6 CPDFDoc_Environment::FFI_GetPage (fpdfsdk/include/fsdk_mgr.h) (frame 6 returns nullptr, and getAnnot call in frame 4 bails) CL extends pdfium_test app with a FFI_GetPage hook implementation. Basically what FFI_GetPage does is returning a FPDF_PAGE instance. In case of pdfium_test, FPDF_PAGE instances were only created on demand when the page was going to get rendered, and then discarded. Since FFI_GetPage can be called by JS before pages are rendered, CL moved the page creation code into a helper function, and cached the FPDF_PAGE instances created in a map, so it does not recreate them needlessly. BUG=pdfium:492 Review-Url: https://codereview.chromium.org/2277063003
2016-08-25Clean up CPDFSDK_PageView methods.jaepark
This CL cleans up CPDFSDK_PageView::LoadFXAnnots and nits. Review-Url: https://codereview.chromium.org/2279563005
2016-08-25Change " to ' in gyp file for consistencynpm
Review-Url: https://codereview.chromium.org/2276343006
2016-08-25CPDF_Annot::GetRect() should return CFX_FloatRect.jaepark
Avoid using reference argument and return CFX_FloatRect instead. Review-Url: https://codereview.chromium.org/2278153005