summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-01-05[libtiff] Fixup unitialized access issueDan Sinclair
This CL initializes the raw tif data to guard against unitialized memory access. BUG=chromium:677377 Change-Id: If272fafacd996c2e93a41fb6e477661dc0c5492c Reviewed-on: https://pdfium-review.googlesource.com/2150 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-05Cleaning up memory allocation in CXFA_FM2JSContext - IIDan Sinclair
This CL removes the size arrays and variables and uses the vector to get the size directly. Change-Id: I0f7b5f48e53ff1ec379ad34a23807d70b02a538a Reviewed-on: https://pdfium-review.googlesource.com/2155 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-05Banish CFX_Points, CFX_PointsF, and CFX_RectFArray to XFA-side only.tsepez
Removes more array template usage fron non-XFA code. Review-Url: https://codereview.chromium.org/2614013002
2017-01-05Fix bCJK calculation in Windows MapFontnpm
I think the bCJK variable calculation is wrong. If not, then it is not necessary, since currently it will always be set to false. CL that added this code: https://codereview.chromium.org/1306883002/ Review-Url: https://codereview.chromium.org/2611843008
2017-01-05Cleaning up memory allocation in CXFA_FM2JSContext - Ichromium/2974Dan Sinclair
This CL updates ::ParseResolveResult to accept a std::vector<std::unique_ptr<CFXJSE_Value>>& instead of a CFXJSE_Value**&. This removes a bunch of manual new/delete code used to mantain the values. The size parameter was also removed and is retrieved by calling .size() on the vector now. Change-Id: I60fc6176523ece112d41fdefc767aaefedfae2db Reviewed-on: https://pdfium-review.googlesource.com/2153 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-05Properly ref-count CFGAS_GEFont with CFX_RetainPtr.tsepez
We worry about cyclical references, but no leaks found. Review-Url: https://codereview.chromium.org/2609423003
2017-01-05Remove CFX_MapPtrToPtr from xfa/fxfa.tsepez
Review-Url: https://codereview.chromium.org/2612923002
2017-01-05Remove unused CPDF_ImageCacheEntry::GetCachedBitmapNicolas Pena
GetCachedBitmap method is not being used. This removal simplifies some of the code. Change-Id: I075c245c3511e8a1b595c8ba148991f7c838f504 Reviewed-on: https://pdfium-review.googlesource.com/2154 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-05remove unused CFX_PtrToInt32 typedeftsepez
Review-Url: https://codereview.chromium.org/2617723002
2017-01-05Remove CFX_MapPtrToPtr from xfa/fde.tsepez
Fix spelling of "pseudo" along the way. Remove some FDE_LPCxxx typedefs for the sake of clarity. Review-Url: https://codereview.chromium.org/2616813002
2017-01-04Kill render_int.hchromium/2973chromium/2972Nicolas Pena
CPDF_DIBSource was already in its own file, but files needed renaming. Change-Id: Ib3ac787a0bb33d3f78ecdcdfcdbc938867857a14 Reviewed-on: https://pdfium-review.googlesource.com/2152 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-04Add missing operator<() to CFX_RetainPtr.tsepez
Use std::less<>() rather than a direct ptr1 < ptr2 comparison to be strictly correct in face of unspecified behaviour when ptr1 and ptr2 don't point within the same "object" (e.g. segment of memory on a brain-dead segmented architecture). This will allow their use as keys in maps. Review-Url: https://codereview.chromium.org/2616683002
2017-01-04Remove CFX_ArrayTemplate, use unique_ptr in fpdfsdk/pdfwindowtsepez
Review-Url: https://codereview.chromium.org/2594153003
2017-01-04Remove CFX_ArrayTemplate in BC_QRCoderEncoder.tsepez
Also, class Make_Pair is confusing given std::make_pair(). No need for vectors of pointers when there are reasonable copy ctors. Save 288 bytes in a table while we're at it, and make local to file. Fix spelling of "Numberic". Review-Url: https://codereview.chromium.org/2595203002
2017-01-03Add CFX_RetainPtr Leak() and Unleak() methodstsepez
Required to pass pointers across C-APIs. Need this to clean up CPDFXFA_Page and retain ptrs. Review-Url: https://codereview.chromium.org/2583093003
2017-01-03remove some CFX_ArrayTemplate in xfa_ffdocview.hchromium/2971tsepez
Review-Url: https://codereview.chromium.org/2593163002
2017-01-03Cleanup ThemeProvider codeDan Sinclair
Remove unused methods, fold the arrow data into the CFWL_WidgetTP instead of a custom class and global object. Change-Id: Ie942052555d6c8668d27072c1fcc5e8e00597518 Reviewed-on: https://pdfium-review.googlesource.com/2139 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Remove the ::GetCapacity methods.Dan Sinclair
The GetCapacity methods return a void* because they return different types of internal class memory based on what the calling parameter was. This is confusing and makes it difficult to tell when then enum values can be removed. This CL removes GetCapacity and adds methods as needed to get the real values. Change-Id: I64c2edc858220624880e27f4ed49c2dae080f462 Reviewed-on: https://pdfium-review.googlesource.com/2137 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-03Create individual exception methods.Dan Sinclair
This CL removes the LoadString method from CPDFXFA_Context and, instead, creates individual exception methods for each of the loaded strings and calls as needed. BUG=pdfium:549 Change-Id: I1d975f01f13f45a885946a9952f24b13387dc3e4 Reviewed-on: https://pdfium-review.googlesource.com/2135 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Convert CFWL_MonthCalendar to use return valuesDan Sinclair
This CL updates CFWL_MonthCalendar to return values instead of taking an out parameter. Change-Id: I347d0e85897be1359bad7971d82c70dfad0d69a0 Reviewed-on: https://pdfium-review.googlesource.com/2132 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Check for overflow in JBig2 Huffman decoderDan Sinclair
This CL updates the Huffman decoder in the JBig2 codex to check the low field does not overflow. BUG=chromium:675236 Change-Id: I7f5f6fe8329df4ece6f317fac521fe2373686479 Reviewed-on: https://pdfium-review.googlesource.com/2131 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Remove more CFX_ArrayTemplate in cfwl_notedriver.h.tsepez
Also pass some unqiue_ptr further down while we're at it. Review-Url: https://codereview.chromium.org/2594103002
2017-01-03Kill last use of CFX_PtrList.tsepez
I'd been waiting on this hoping the code would be refactored out of existence, but it looks to be used. Use tests against x.end() in place of a "null position". This is greatly complicated by the use of "tail position", which now calcluated by std::prev(x.end()) unless the list is empty. Review-Url: https://codereview.chromium.org/2592163002
2017-01-03Remove CFWL_ListBox::GetDataProviderItemTextDan Sinclair
This method just proxies to the provided item now. Remove the method and call GetText() directly if possible. Change-Id: Ida49e0e878f859a69f7d5bec9d0f734feb7a763d Reviewed-on: https://pdfium-review.googlesource.com/2130 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Cleaning out params in CPDFXFA_ContextDan Sinclair
This CL cleans up some of the out params in CPDFXFA_Context. In the process several of the strings returned by ::LoadString() are inlined in their call sites and the defines removed. BUG=pdfium:549 Change-Id: I41a7ceeba3962299eecd0cb714ddb03d28dbb0ea Reviewed-on: https://pdfium-review.googlesource.com/2134 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Use return values in CFWL_Scrollbar instead of out paramsDan Sinclair
This CL updates CFWL_Scrollbar use return values instead of using out params. In some cases, the same values is assigned and passed in, but passing in the const ref is a lot clearer as to what is happening. Change-Id: Iff72a845e09ac73ff8eac938482547eaf251f835 Reviewed-on: https://pdfium-review.googlesource.com/2133 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-03Force stop of page tree traversal when max level reachedNicolas Pena
The previous implementation, FindPDFPage, was already doing this since the recursive call was always with return. Currently, we were trying to keep going even after reaching max level. The problem is that if the page tree is not a tree, we might loop forever. This could also be solved by keeping track of the dictionaries that have been visited, but this solution takes much less space. BUG=672172 Change-Id: Ia37aea58e92b6068de69f26736c612aa6a0ff4b3 Reviewed-on: https://pdfium-review.googlesource.com/2138 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-01-03Libtiff update with upstreamNicolas Pena
This CL makes the fix to the bug equal to that which has now been submitted upstream. Link: https://github.com/vadz/libtiff/commit/fa6b22a5135fdeabe860097c04f298ca0ae7f2e1 Our original CL for fixing the bug: https://codereview.chromium.org/2545723004/ BUG=657473 Change-Id: I52ae6a062ac07a0e20d0ba4ab823cbbf1d2b1ac1 Reviewed-on: https://pdfium-review.googlesource.com/2136 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-01-02Gold support in PDFiumchromium/2970stephana
Extends the PDFium tests to collect images and meta data to be uploaded to Gold. This feature is triggered by adding the --gold_* flags. It extends pdfium_test to output the MD5 hash of the underlying pixel buffer for each page it renders. That output is then processed by test_runner.py to generate the gold meta data. This behavior is modeled after the 'dm' tool in skia. See https://skia.googlesource.com/skia/+/master/dm/DM.cpp#1090 This should not cause any change in the current behavior of the tests, it will be trigger once we update the buildbot recipe. BUG=skia:5973 Review-Url: https://codereview.chromium.org/2578893004
2017-01-02Use vector of unique_ptrs for page node children.tsepez
Also be sure that a loop terminates without relying on specific behaviour of the callers. Review-Url: https://codereview.chromium.org/2598473002
2016-12-28Make CFX_Observable copy constructable.chromium/2969chromium/2968chromium/2967chromium/2966tsepez
Fix some naming to make things clearer. Review-Url: https://codereview.chromium.org/2587233002
2016-12-19Missing null initializer in CPDF_StreamParser::ReadInlineStreamchromium/2965chromium/2964chromium/2963chromium/2962chromium/2961chromium/2960chromium/2959chromium/2958tsepez
TBR=dsinclair@chromium.org BUG=675752 Review-Url: https://codereview.chromium.org/2585113004
2016-12-19Relax the EncryptMetadata check.chromium/2957tsepez
BUG=pdfium:644 Review-Url: https://codereview.chromium.org/2581873002
2016-12-16lcms: Sanitize floating point readchromium/2956chromium/2955kcwu
This is partially backported from upstream https://github.com/mm2/Little-CMS/commit/4011a6e3 BUG=chromium:665054 Review-Url: https://codereview.chromium.org/2577963007
2016-12-16Return unique_ptr<> from IPDF_StructTreetsepez
Delete some dead code in the process. Review-Url: https://codereview.chromium.org/2585873002
2016-12-16Better tests for password protected documents.chromium/2954tsepez
- Add unit tests for sha256 implementation. - Remove void* types from API in favor of correct actual types. Review-Url: https://codereview.chromium.org/2577223002
2016-12-15Return unique_ptr from CFX_BinaryBuf::DetachBuffer()tsepez
In turn, make CPDF_Stream() take an unique_ptr. Review-Url: https://codereview.chromium.org/2584683002
2016-12-15Move window type mask up with masked flagsdsinclair
Move code to make clear what is being masked. Review-Url: https://codereview.chromium.org/2573163002
2016-12-15Remove widget offscreen code.dsinclair
The Offscreen state was never set, removed. Review-Url: https://codereview.chromium.org/2569663006
2016-12-15Cleanup widget edge related codedsinclair
CFWL_Widget::HasEdge() always returns false. This CL removes it and the supporting code. Review-Url: https://codereview.chromium.org/2575093002
2016-12-15Remove more unused widget stylesdsinclair
Remove more FWL Widget Styles which are never set. Review-Url: https://codereview.chromium.org/2578473003
2016-12-15Remove unused widget state flagsdsinclair
These widget state flags are not set and mostly unused. Removed. Review-Url: https://codereview.chromium.org/2573133002
2016-12-15Remove unused sysbtn codedsinclair
This CL removes the unused FWL_WGTSTYLE_MinimizeBox, FWL_WGTSTYLE_MaximizeBox, and FWL_WGTSTYLE_CloseBox along with the supporting code. Review-Url: https://codereview.chromium.org/2578603002
2016-12-14Remove unused m_OtfFontData.chromium/2953tsepez
In turn, this makes CFX_BinaryBuf::AttachData() unused. Review-Url: https://codereview.chromium.org/2578793002
2016-12-14Return unique_ptr from CXFA_FFApp::CreateDoc.tsepez
Remove one unused CreateDoc variant. Review-Url: https://codereview.chromium.org/2576893002
2016-12-14More unique_ptr returns from DIB methods.tsepez
Review-Url: https://codereview.chromium.org/2572293002
2016-12-14Remove unused flags in CFWL_PushButtonchromium/2952dsinclair
Review-Url: https://codereview.chromium.org/2571863002
2016-12-14Return unique_ptr from GetAlphaMask.tsepez
Rename GetAlphaMask => CloneAlphaMask since it does more than get. Rename CopyAlphaMask => SetAlphaMask, as it copies IN, not OUT. ditto for CopyPalette => SetPalette. BUG= Review-Url: https://codereview.chromium.org/2572243002
2016-12-14Cleanup CFWL_MonthCalendar flagsdsinclair
Remove unused flags in CFWL_MonthCalendar. Review-Url: https://codereview.chromium.org/2570943002
2016-12-14Remove some usage of |return XXX.release()| anti-pattern.tsepez
Review-Url: https://codereview.chromium.org/2571313002