summaryrefslogtreecommitdiff
path: root/core/fxcrt
AgeCommit message (Collapse)Author
2018-04-12Return pdfium::span<char> from ByteString::GetBuffer().Tom Sepez
Get bounds checking "for free". Change-Id: I7b14cacbc7130ced7b5cb1869b82c96ccff8e642 Reviewed-on: https://pdfium-review.googlesource.com/30451 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-12Return pdfium::span<wchar_t> from WideString::GetBuffer().Tom Sepez
Adds bounds checking "for free", but beware of span outliving a ReleaseBuffer() call. Scoping as such avoids the possibility of using an invalid span (and it is flagged as a lifetime issue). Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c Reviewed-on: https://pdfium-review.googlesource.com/30310 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-12Fixup CFX_XMLParser::GetStatus returnDan Sinclair
This CL fixes the return type of CFX_XMLParser::GetStatus to correctly return bool instead of int32_t. Change-Id: Ifa0d24b8aad55c4cf63ddf7cfc8eee48bf8431bf Reviewed-on: https://pdfium-review.googlesource.com/30290 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Remove CFX_XMLDoc and call the parser directlyDan Sinclair
This CL removes the CFX_XMLDoc and calls the CFX_XMLParser directly from CXFA_DocumentParser. Change-Id: I4d715cca90cd15b5e1d79827e0bb2781e873e371 Reviewed-on: https://pdfium-review.googlesource.com/30251 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Allow retrieving the XML tree from the CFX_XMLDocDan Sinclair
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Merge CFX_XMLParser and CFX_XMLSyntaxParserDan Sinclair
The CFX_XMLParser was a wrapper around the CFX_XMLSyntaxParser. This CL merges the SyntaxParser into protected/private methods if the XMLParser. Change-Id: If1519b5de55866ed14359dffd64dc12c36ee0244 Reviewed-on: https://pdfium-review.googlesource.com/30171 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Cleanup some CFX_XMLParser codeDan Sinclair
This CL cleans up minor nits in the CFX_XMLParser code. Change-Id: Ie19d12d3dcce16c9ce6088160ecdec3d9855c11f Reviewed-on: https://pdfium-review.googlesource.com/30170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12[xfa] Remove form checksum abilitiesDan Sinclair
This CL removes the code for verifying and creating checksums associated with form elements in XFA documents. This was the only code requiring the SAXReader which has also been removed. According to the XFA spec and application can decide which parts of the signatures are supported. This feature is being removed until we determine if/when it is needed. Bug: pdfium:1063 Change-Id: Iec2261282340f8fc72a1225d2e0d3e6ddf05edcb Reviewed-on: https://pdfium-review.googlesource.com/30150 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-11Fix issues with PDFium third_party/base/span.hTom Sepez
Remove stray const in operator[] that was introduced when downgrading from C++14 to C++11 syntax. Add missing Get() in first() that was introduced when converting to UnownedPtr. Prevent ASAN from flagging spans where the UnownedPtr points to byte N+1 of a N byte object, and the span is empty. This is legal in C for ordinary pointers so long as the pointer isn't de-referenced, but is not allowed per the rules for UnownedPtr. Change-Id: Ic143c5ef4e37c1cf86f0a3e5408be6e2076a85e2 Reviewed-on: https://pdfium-review.googlesource.com/30212 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-10Add static_asserts for FX_RECT and FX_COLORREF.Lei Zhang
Make sure they match their win32 equivalent data types. Change-Id: I395054ce5c5ae110c78dbae30dd985fc498045fb Reviewed-on: https://pdfium-review.googlesource.com/30070 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-10Remove CFX_Rect.Lei Zhang
It is rarely used and FX_RECT is the more common integer rect type. Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61 Reviewed-on: https://pdfium-review.googlesource.com/30053 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-10Change FillRectWithBlend methods to take FX_RECT by const-ref.Lei Zhang
They currently take const FX_RECT*, but the pointer is never nullptr. Also add a comment to explain why FX_RECT is the way it is. It has the same layout as a win32 RECT. Change-Id: Icf0e4c3eb25fe03317590a736578e053b9dccf7a Reviewed-on: https://pdfium-review.googlesource.com/30051 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-09Use pdfium::span<> in CFX_BitStream, CPDF_SimpleParser.Tom Sepez
Get bounds checks in parsers automatically when using spans. Change-Id: I71fbe7b838435d455376db2f89817d807a9cdcfd Reviewed-on: https://pdfium-review.googlesource.com/29830 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-09Make StringViewTemplate be based on pdfium::span<>.Tom Sepez
Change-Id: I13d3e462c86d035bbb992696aab523df5642533b Reviewed-on: https://pdfium-review.googlesource.com/29811 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-09Make pdfium::span<> be based off of UnownedPtr<>.Tom Sepez
Because we can get the lifetime check for free if we do this. This requires adding some "constexpr/noexcept" to UnownedPtr to make the types line up with what span.h requires. Change-Id: I45918f8723122082036eed959f769644ab4c509f Reviewed-on: https://pdfium-review.googlesource.com/29672 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-09Move the CFX_XMLParser out of CXFA_SimpleParserDan Sinclair
This CL removes the CFX_XMLParser from CXFA_SimpleParser and constructs it in the CFX_XMLDoc. Change-Id: Id69b396f091892170a4c4654ac1d0fd65d1efbb6 Reviewed-on: https://pdfium-review.googlesource.com/29970 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-06Add span.h from chromium base.chromium/3392Tom Sepez
Allows indexing with better bounds-checking to occur. Some small modifications are required to deal with PDFium being intentionally held at C++11 compliance, not C++14. Use in one place as check on correctness. Change-Id: Id2875cf0a93980112bc536a93c4f9ec5306c0dac Reviewed-on: https://pdfium-review.googlesource.com/29671 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Chris Palmer <palmer@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-04Decrease XML parser buffer sizeDan Sinclair
This CL decreases the m_iXMLPlaneSize in the CFX_XMLSyntaxParser from 32*1024 to 1024 bytes. This plane size is the size of the chunks we read the XML file in. The issue with having a large plane size is inside the CFX_SeekableStreamProxy::ReadString we allocate a vector of the min(planeSize, remaining_bytes). This means, we could potentially be allocating 32*1024 bytes to read in a single character. For the test in the attached bug the runtime went from 12s to 25ms. Bug: chromium:813195 Change-Id: Id57e619b7a118d45e3fed491ad81e86a4b1cacb8 Reviewed-on: https://pdfium-review.googlesource.com/29750 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-03Re-arrange so inline vectors come last in structs.Tom Sepez
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-03-16Make more variables const-ref.chromium/3373Lei Zhang
Found by ClangTidy. BUG=pdfium:1040 Change-Id: I6d7cb26ae2d12f5650f73596d0b991234b076f57 Reviewed-on: https://pdfium-review.googlesource.com/28712 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-15Use Width()/Height() methods from rectangles.Lei Zhang
Change-Id: I07f4363046be920816e8d0dae766c7af833284db Reviewed-on: https://pdfium-review.googlesource.com/28582 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-14Fix bad return value in WideString::Compare().chromium/3371Lei Zhang
When comparing L"a" vs L"ab", the return value should be -1 or 1, not 0 or 1. Add a regression test for this case. BUG=chromium:821454 Change-Id: I38e2d7ca62319b7a62f8d8afeb231b8ed3bd9e86 Reviewed-on: https://pdfium-review.googlesource.com/28570 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-13Remove usage of FXSYS_*ASCIIlower/upper methodschromium/3370Ryan Harrison
This replaces them with equivalent FXSYS_*wlower/upper methods, which uses ICU to perform the correct Unicode operations. BUG=pdfium:1035 Change-Id: I432db5bef9eda71762016b619d93155949d054db Reviewed-on: https://pdfium-review.googlesource.com/28530 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIspacechromium/3369Ryan Harrison
This replaces it with FXSYS_iswspace, which uses ICU to perform correct Unicode space checking. BUG=pdfium:1035 Change-Id: I7a4ed01a6b50f56a6f9d1434a7f0b01596fe42db Reviewed-on: https://pdfium-review.googlesource.com/28510 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalphaRyan Harrison
Instances are either replaced with FXSYS_iswalpha, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalpha pair, if ASCII alpha is actually what was wanted. BUG=pdfium:1035 Change-Id: I971ff639ee1ff818ad08793a1900a8bcbb0a3e04 Reviewed-on: https://pdfium-review.googlesource.com/28450 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalnumRyan Harrison
Instances are either replaced with FXSYS_iswalnum, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalnum pair, if ASCII alnum is actually what was wanted. BUG=pdfium:1035 Change-Id: I959ec8739a4d020e61562180393ab8113a81577c Reviewed-on: https://pdfium-review.googlesource.com/28430 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-09Explicitly mark helper methods that only operate on ASCII rangesRyan Harrison
A number of our character helper methods take in wide character types, but only do tests/operations on the ASCII range of characters. As a very quick first pass I am renaming all of the foot-gun methods to explictly call out this behaviour, while I do a bigger cleanup/refactor. BUG=pdfium:1035 Change-Id: Ia035dfa1cb6812fa6d45155c4565475032c4c165 Reviewed-on: https://pdfium-review.googlesource.com/28330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-26Add some more missing consts.chromium/3356Tom Sepez
Get things out of the .data section. Change-Id: I375cf00186a3d5d8d10f5d147bd4b692f5db3683 Reviewed-on: https://pdfium-review.googlesource.com/27130 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-16Implement operator<< for CFX_Rect and CFX_RectF.Henrique Nakashima
This is for debugging, so gated by #ifndef NDEBUG. Also make label the printed values to make them clear and differentiate top>bottom and bottom>top rect systems. Change-Id: I2d816b6b8b1be5fb5464630e771d200f2534917e Reviewed-on: https://pdfium-review.googlesource.com/26911 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-02-16Fix fallthroughs in XFA code.chromium/3350Henrique Nakashima
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f Reviewed-on: https://pdfium-review.googlesource.com/26950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-02-15Make the CFX_XMLNode a MaybeOwned pointerDan Sinclair
This CL removes the HasOwnXML flag from the CXFA_Node objects and instead uses a MaybeOwned pointer to keep track of the XML nodes. Change-Id: Ie678258247ec21ecb15c639647b189e140586d25 Reviewed-on: https://pdfium-review.googlesource.com/26811 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-13Add last_child to CFX_XMLNodeDan Sinclair
This CL adds the list_child_ member into CFX_XMLNode to keep it consistent with other tree's in the system. Change-Id: I2e64f11fb9c7df40dd3467edcce177fc492d2cd2 Reviewed-on: https://pdfium-review.googlesource.com/26670 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-13Split CFX_XMLNode::SaveXMLNode apartDan Sinclair
This CL removes the switch from SaveXMLNode and moves the required code into override methods in the child classes. The method is renamed from SaveXMLNode to just Save. Change-Id: I2011b80525e99635c573b4e0cf977e94f6b7cea6 Reviewed-on: https://pdfium-review.googlesource.com/26590 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-13Cleanup CFX_XMLNode pointersDan Sinclair
This CL cleans up hte CFX_XMLNode pointers. Each pointer has been renamed to make the usage clearer, the NodeItems method has been removed in favour of distinct accessors and the node pointers have been made private. Change-Id: I5459a77a0ae93b08741a0cd59266ef9c81ddad75 Reviewed-on: https://pdfium-review.googlesource.com/26550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-13Cleanup CFX_XMLDoc::SaveXMLNodeDan Sinclair
The CFX_XMLDoc::SaveXMLNode method is almost an exact copy of the CFX_XMLNode::SaveXMLNode. This CL removes the XMLDoc variant and calls the XMLNode method directly. This Removes the need to pass the CXFA_DocumentParser into CXFA_Document and we can instead pass in the CXFA_FFNotify object directly. Change-Id: Ic3c8c66375483fe73b44dd84064a1b71b039d61c Reviewed-on: https://pdfium-review.googlesource.com/26530 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-13Cleanup CFX_XMLNode and friendschromium/3347Dan Sinclair
This CL removes unused methods from CFX_XMLNode, adds an AppendChild to handle the case of a -1 index to InsertChildNode, removes the InsertChildNode return value which is unused and cleans up various other things. Change-Id: I3a022e4dc2afffa6893ad11014034dd7ed301f13 Reviewed-on: https://pdfium-review.googlesource.com/26510 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-12Convert CFX_BmpDecompressor to use CFX_MemoryStreamRyan Harrison
This also adds a Seek method to CFX_MemoryStream BUG=pdfium:1007 Change-Id: I2c7e1d3b6d8aff36e302014cb2e8ffc0f23ef7c4 Reviewed-on: https://pdfium-review.googlesource.com/26230 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-02-12Rearrange allocator functions to avoid unreachable codeDaniel Bratell
FX_AllocOrDie, FX_AllocOrDie2D and FX_ReallocOrDie contained unreachable code which in jumbo builds with some Visual Studio versions/configurations resulted in a compiler warning. By reordering the code, the unreachable code can be removed. Bug: pdfium:964 Change-Id: I8c040a31ea6af0ca896d8f68297e263719d6bdfa Reviewed-on: https://pdfium-review.googlesource.com/26190 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-10Renable -Wimplicit-fallthrough for PDFium.Nico Weber
Didn't find any bugs, but also doesn't require much boilerplate. Bug: TODO Change-Id: I5f30183c55216f1333c79fcb46476d281720873e Reviewed-on: https://pdfium-review.googlesource.com/26210 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org>
2018-02-05Include time.h on wasm.chromium/3342chromium/3341Henrique Nakashima
Bug: chromium:804907 Change-Id: Id9b496f14134631d3308c073b8780bf18c2305c8 Reviewed-on: https://pdfium-review.googlesource.com/25270 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-02-01Convert CFX_CSSPropertyTable to CFX_CSSDataRyan Harrison
This converts the existing class naming and references. The ::Entry struct is converted to ::Property. The GetBy* methods are renamed to GetPropertyBy*. Free functions from other parts of the CSS code base are merged into the class. GetCSSPropertyValueByName becomes ::GetPropertyValueByName with a return value of ::PropertyValue*. GetCSSLengthUnitByName becomes ::GetLengthUnitByName with a return value of ::LengthUnit*. GetCSSColorByName becomes ::GetColorByName with a return value of ::Color*. BUG=pdfium:998 Change-Id: I5b78c69d0fe53ad714ac3545cfdda8c26b95e4d5 Reviewed-on: https://pdfium-review.googlesource.com/25010 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSColorByNamechromium/3336Ryan Harrison
BUG=pdfium:798 Change-Id: I9f0cc6fa095f111d6c43034b55f5e12e2bcab059 Reviewed-on: https://pdfium-review.googlesource.com/24716 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSLengthUnitByNameRyan Harrison
BUG=pdfium:798 Change-Id: I97d0dc566f95736ef12eda90ee0bf336cba42098 Reviewed-on: https://pdfium-review.googlesource.com/24715 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSPropertyValueByNameRyan Harrison
BUG=pdfium:798 Change-Id: I1e50aeffa439063bc9eb2640af457e33c4e3c46c Reviewed-on: https://pdfium-review.googlesource.com/24713 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-31Clean up CSS property tableRyan Harrison
Reorganizes the free functions to be static methods on a class. Converts the Table struct to be an Entry struct defined in the class. Change-Id: I9eca0dfb15187af10cbe2dc4b4c2756d55d957be Reviewed-on: https://pdfium-review.googlesource.com/24712 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-30Clean up CSS Data Table entries and accessRyan Harrison
This cleans up the entries in the table to no longer have a marker for size, and also removes a hand rolled search. This prevents an out of bounds issue that had been reported and addresses another potential out of bounds issue. BUG=chromium:807214 Change-Id: I3d3ab5a3a174dd4dcec56fa7ee7a0e6c2805bfaa Reviewed-on: https://pdfium-review.googlesource.com/24690 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-30Revert "Revert "Use UnownedPtr instead of T* in MaybeOwned.""Tom Sepez
This reverts commit 77d8ed02c7e97471ceccee5abbabeb2fdea413c7. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Use UnownedPtr instead of T* in MaybeOwned." > > This reverts commit e563e8352139e4852a955e319023b09f2844aee9. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Use UnownedPtr instead of T* in MaybeOwned. > > > > Always check the liftime in the unowned case. Doing so unearthed > > the following issues: > > > > Transient lifetime issue in jbig2_image when doing realloc(). > > Stale (but unused) dictionary pointer in CPDF_Image. > > Destruction order in error branch in cpdf_dibsource.cpp > > > > Change-Id: I12b758aafeefedc7abe1e8b21a18db959929e95f > > Reviewed-on: https://pdfium-review.googlesource.com/24552 > > Commit-Queue: Tom Sepez <tsepez@chromium.org> > > Reviewed-by: dsinclair <dsinclair@chromium.org> > > TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org > > Change-Id: I3c56ee6ab502da90e3adb7507dbc8cc92f090140 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://pdfium-review.googlesource.com/24670 > Reviewed-by: Tom Sepez <tsepez@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org Change-Id: I0ccbbeab8be6cadc9b3a5bfefe2aca733654342f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/24671 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-01-30Revert "Use UnownedPtr instead of T* in MaybeOwned."Tom Sepez
This reverts commit e563e8352139e4852a955e319023b09f2844aee9. Reason for revert: <INSERT REASONING HERE> Original change's description: > Use UnownedPtr instead of T* in MaybeOwned. > > Always check the liftime in the unowned case. Doing so unearthed > the following issues: > > Transient lifetime issue in jbig2_image when doing realloc(). > Stale (but unused) dictionary pointer in CPDF_Image. > Destruction order in error branch in cpdf_dibsource.cpp > > Change-Id: I12b758aafeefedc7abe1e8b21a18db959929e95f > Reviewed-on: https://pdfium-review.googlesource.com/24552 > Commit-Queue: Tom Sepez <tsepez@chromium.org> > Reviewed-by: dsinclair <dsinclair@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org Change-Id: I3c56ee6ab502da90e3adb7507dbc8cc92f090140 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/24670 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-01-30Use UnownedPtr instead of T* in MaybeOwned.Tom Sepez
Always check the liftime in the unowned case. Doing so unearthed the following issues: Transient lifetime issue in jbig2_image when doing realloc(). Stale (but unused) dictionary pointer in CPDF_Image. Destruction order in error branch in cpdf_dibsource.cpp Change-Id: I12b758aafeefedc7abe1e8b21a18db959929e95f Reviewed-on: https://pdfium-review.googlesource.com/24552 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>