summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-12-04Remove XFA isolate trackerdan sinclair
We don't add anything to the tracker lists so we can remove the tracker. The only thing the Initialize and Finialize methods are doing now is to trigger a v8::V8::Dispose which should happen automatically at exit anyway. Change-Id: I1f783ae5a1df3df63fb067ab30310791b6c44929 Reviewed-on: https://pdfium-review.googlesource.com/20192 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-04Fix nits in CPDF_Type3Font.Lei Zhang
Change-Id: Ib922184ee844e66a0b29f49025e83e13eb81fdb8 Reviewed-on: https://pdfium-review.googlesource.com/20214 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-12-04Remove unused XFA codedan sinclair
Change-Id: Iea75ce6b3a7e06b7977491a89e7a31755f038312 Reviewed-on: https://pdfium-review.googlesource.com/20191 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-12-04Break out CFX_ImageTransformer mask calculations.Lei Zhang
Change-Id: Iab7ff29c2ce9ed56715b5897e89da2d9d693583c Reviewed-on: https://pdfium-review.googlesource.com/20252 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Add functions for common code in CFX_ImageTransformer.Lei Zhang
Change-Id: I556934f61f24883e684865e4a8fc5e0519248cee Reviewed-on: https://pdfium-review.googlesource.com/20251 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Make a CXFA_DocumentParser member Unowned.Lei Zhang
Fix/cleanup ctors/dtors in related classes. Change-Id: Ia05ec9b6892fd7d19d0a417fc1226a407e3ac260 Reviewed-on: https://pdfium-review.googlesource.com/20216 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-04Make CXFA_SimpleParser members const or Unowned.Lei Zhang
Fix ownership issues, and simplify CXFA_SimpleParser ctors. Change-Id: Ie083080297c5c2586ae3e6a8355839fcb86ee9ea Reviewed-on: https://pdfium-review.googlesource.com/20130 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-01Get rid of else after break/continue/return.chromium/3284chromium/3283Lei Zhang
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3 Reviewed-on: https://pdfium-review.googlesource.com/20110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-01Check for success of decodes to avoid infinite loopsNicolas Pena
Bug: 790693 Change-Id: I9b1d87e024229d8b01f55ec554e2cc544db6ac06 Reviewed-on: https://pdfium-review.googlesource.com/20230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-12-01Add CFX_FloatRect::ToRoundedFxRect().Lei Zhang
Unlike ToFxRect(), which floors the LBRT values. Also fix some nits. Change-Id: I0680eebb09031807a14402ca30b13558ea5b56d9 Reviewed-on: https://pdfium-review.googlesource.com/20213 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-12-01Add CFX_FloatRect::Scale().Lei Zhang
Unlike ScaleFromCenterPoint(), Scale() just scales the LBRT values. Also add unit tests for CFX_FloatRect::Normalize(). Change-Id: Iebf48fa9adcf47adff3255b157d3e3056f3687fc Reviewed-on: https://pdfium-review.googlesource.com/20212 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-12-01Rename CFX_FloatRect::Scale() to ScaleFromCenterPoint().Lei Zhang
Change-Id: I6baab14c989e8ae692ed1c846b135af95c09ce37 Reviewed-on: https://pdfium-review.googlesource.com/20210 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-12-01Remove unused CFX_FloatRect::Substract4().Lei Zhang
Change-Id: I08706f53bf3960cbea60b09a1702bf0ba371f1ce Reviewed-on: https://pdfium-review.googlesource.com/20211 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-01Add some CFX_FloatRect unit tests.Lei Zhang
Change-Id: I32cc3cb0a8a987980b900a5650cc051cb50dd1cc Reviewed-on: https://pdfium-review.googlesource.com/20190 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-12-01Remove unneded structs from CFX_CTTGSUBTable part 2Nicolas Pena
This CL continues removing structs from CFX_CTTGSUBTable Change-Id: I1ede1e3e736f87292b6119406fd5f12a0bb7e7cb Reviewed-on: https://pdfium-review.googlesource.com/20170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-12-01Encapsulate CPDF_Type3Char members.Lei Zhang
Change-Id: Iec4e999d76dabc9b6cd00323881c5c87afc5f629 Reviewed-on: https://pdfium-review.googlesource.com/19930 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Simplify XDP parsing codeDan Sinclair
This CL cleans up the XDP packet parsing code. This is followup from a previous CL. Change-Id: Ic4a855e67e1b22d0703e53e9a2a9b4923775b6ad Reviewed-on: https://pdfium-review.googlesource.com/20090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Rename XFA_ATTRIBUTEENUM to XFA_AttributeEnum enum classDan Sinclair
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class XFA_AttributeEnum. Methods expecting an int32 have been updated to take or return the XFA_AttrbuteEnum type. Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763 Reviewed-on: https://pdfium-review.googlesource.com/20070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Move packet information into simple parserDan Sinclair
This CL moves the packet information into the anonymous namespace of the simple parser. There is slight duplication in that two of the namespace URIs have been copied into other files but this duplication allows for a bunch of simplification. Change-Id: I33092424ff4cb57eaf85da97a92fa6cf7b11f2ef Reviewed-on: https://pdfium-review.googlesource.com/20050 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30Make parsers work off XFA_PacketType enumDan Sinclair
This CL changes the various parsers to use XFA_PacketType instead of XFA_XDPPACKET. This just leaves XFA_XDPPACKET for determining if a given node can be created in a given packet. Change-Id: I6fd23480c0c780a131d23b64b7c7e9d8684b0220 Reviewed-on: https://pdfium-review.googlesource.com/20013 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30A CXFA_Node can only be in one packetDan Sinclair
When a CXFA_Node is created it's created as part of a specific packet. Previously the code would accept an XFA_XDPPACKET which was stored internally. This had the potential to allow a node to exist in multiple packets. This CL changes the XFA_XDPPacket to the XFA_PacketType enum class and cleans up a lot of uses to use the more specific packet type. Change-Id: I7fc8c843bfa6bd32295ae58a26bcec311e43c4b0 Reviewed-on: https://pdfium-review.googlesource.com/20012 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Cleanup XFA packet codeDan Sinclair
Remove GetPacketByID, move GetPacketByName to the xfa_utils file. Cleanup CreateNode to accept the XFA_XDPPACKET instead of the packet info. Change-Id: I0f246c84f61b6b4175ca307bdcd125d9bc24bb1e Reviewed-on: https://pdfium-review.googlesource.com/20010 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Rewrite lower level details of extracting text from pageRyan Harrison
The current implementation of text extraction was difficult to understand, duplicated logic that existed in other methods, and wasn't clear about the units the inputs were in. It also didn't handle control characters correctly. The new implementation leans on the methods for converting indices between the text buffer index and character list index spaces to avoid duplication of code. It also makes it clear to the reader that inputs are in the character list index space. Finally, it fixes issues being seen in Chrome with respect of ranges being slightly off. This CL also adds a test for extracting text that has control characters. BUG=pdfium:942,chromium:654578 Change-Id: Id9d1f360c2d7492c7b5a48d6c9ae29f530892742 Reviewed-on: https://pdfium-review.googlesource.com/20014 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-11-30Create CXFA_Node::NameToAttributeEnumDan Sinclair
This CL removes XFA_GetAttributeEnumByName and moves the functionality into CXFA_Node::NameToAttriuteEnum. Change-Id: Id1484103c62bf7728d5406c22fb9d83fc0e032e1 Reviewed-on: https://pdfium-review.googlesource.com/19791 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Move setting of XML content back to specific set methodsDan Sinclair
This removes the need for the casting as we know the type in the caller. Change-Id: I9fe30d9f8e6110356549c283980e2f4f37f43d02 Reviewed-on: https://pdfium-review.googlesource.com/19870 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30Rename GetAttributeEnumById to CXFA_Node::AttributeEnumToNameDan Sinclair
This is more consistent with the attribute and element to name methods. Change-Id: I3a7f9246d6fbaffa27a0068d8f93e717f5801d2a Reviewed-on: https://pdfium-review.googlesource.com/19851 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Remove the packets from attribute data.Dan Sinclair
Now that the attributes are stored per node we don't need to store the packets for a given attribute as the node is already restricted to certain packets. Change-Id: Ic8916f5e045a14a437e1487445c0742e6d5def44 Reviewed-on: https://pdfium-review.googlesource.com/19830 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30Generate XFA node attribute informationDan Sinclair
This CL moves the attribute information out of the xfa basic data array and stores in the generated nodes. Change-Id: Id8e280324bf0f75a1da9c937c2734d161324242d Reviewed-on: https://pdfium-review.googlesource.com/19271 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30Fix GBK2K-H CMap usage.Lei Zhang
The data used is clearly a CID Range, but the code was interpreting it as single CID values. Change-Id: Ibb68f5ca2150d74b007a64ef5daa412fd542cecd Reviewed-on: https://pdfium-review.googlesource.com/17650 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Use initializer list in CPDF_DataAvail ctor.Lei Zhang
Or initialize members in the header. Also make m_dwFileLen member const. Change-Id: Iaaeab9a93e18e4ab313437362c0012d729b01647 Reviewed-on: https://pdfium-review.googlesource.com/9970 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Relax checks in CFX_FaceCache::LoadGlyphPath().Lei Zhang
The original fix to https://crbug.com/641333 was too strict. Relax the checks and use a std::tuple for the path map key, instead of trying to "hash" a key. BUG=chromium:788864 Change-Id: I6e6a96691bce2834c2e95baa16ebd39e6aa03140 Reviewed-on: https://pdfium-review.googlesource.com/19950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Prevent integer overflow in CJBig2_HuffmanTable::ParseFromCodedBufferNicolas Pena
In this CL we prevent integer overflow by checking that the integers are in the appropriate range before casting from unsigned to signed. Bug: 789524 Change-Id: I41572849f18ffb0f0739c80130ee6b5061845d29 Reviewed-on: https://pdfium-review.googlesource.com/20011 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-30Run clang-tidy google-readability-casting on //third_party/pdfiumDan Sinclair
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:776257 Change-Id: Iebab34f3ee97a6249e4517d1f5dec1971c36fcba Reviewed-on: https://pdfium-review.googlesource.com/19973 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Run clang-tidy modernize-use-nullptr on //third_party/pdfiumDan Sinclair
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:778942 Change-Id: I5d94299404647d231c0dc8ef8b75a6c0539f378c Reviewed-on: https://pdfium-review.googlesource.com/19972 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-30GCC build fix: access from global function to private methods in ↵José Dapena Paz
CJS_PublicMethods. Build fails on GCC because JSGlobalFunc (a global function) is calling private methods of CJS_PublicMethods. Bug: None. Change-Id: I56f0313e250787d044613066abf069f741501415 Reviewed-on: https://pdfium-review.googlesource.com/19750 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Add LG Electronics to the AUTHORSJosé Dapena Paz
LG Electronics has signed the corporate CLA. Bug: None Change-Id: Idb5fd065439eaf5ef6d15d21adcaefc22cbd0cd6 Reviewed-on: https://pdfium-review.googlesource.com/19910 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-30Run clang-tidy modernize-use-bool-literals on //third_party/pdfiumDan Sinclair
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:778955 Change-Id: Ib037ed749539e4380fb336fc6fa85648fc506118 Reviewed-on: https://pdfium-review.googlesource.com/19990 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Run clang-tidy modernize-use-auto on //third_party/pdfiumDan Sinclair
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:776257 Change-Id: I1f6637cde8b3e41825993a736bed6763dd7beacb Reviewed-on: https://pdfium-review.googlesource.com/19971 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Run clang-tidy modernize-use-equals-{delete,default} on //third_party/pdfiumDan Sinclair
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md In some cases the the tool leaves behind a string of commas where it replaced a member initializer list (https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with: git diff --name-only | \ xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/' Bug: chromium:778959, chromium:778957 Change-Id: I23e60d3d6c8bc9e8574d425710a0441cb5510d6b Reviewed-on: https://pdfium-review.googlesource.com/19970 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Reduce memory limit of PDF XFA fuzzersNicolas Pena
CFX_DIBitmap::Create does an allocation of size roughly 4*width*height even in xfa_codec_fuzzer.h. This CL fixes the memory limit accordingly. Bug: 789359 Change-Id: Ib5cbd08510ecacb2fbd22cb23394d24a86110bc5 Reviewed-on: https://pdfium-review.googlesource.com/19890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-29Allow building pdfium against the system version of libpng.Andrew Weintraub
Bug: Change-Id: I0c930ca30637f58af3b60ed8f1383bd9234a1723 Reviewed-on: https://pdfium-review.googlesource.com/19850 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-29Remove dead CBC_OneDimWriter code.chromium/3281Lei Zhang
Found by GCC. Change-Id: Ia403c21b1906ba6782b5a763c67a19a56de01716 Reviewed-on: https://pdfium-review.googlesource.com/19810 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-29Remove CollectionSize from fx_bidiDan Sinclair
Bug: pdfium:774 Change-Id: I2056583c270f1bb0046250ce2ec53a2cbe46b893 Reviewed-on: https://pdfium-review.googlesource.com/19672 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-29Remove XFA_Unit::AngleDan Sinclair
We never use the ::Angle unit internally, we just access the value. This CL changes the default value to an Integer and drops the measurement. Change-Id: I85d6d84956595bb0576db42d287f54a5a3db1bed Reviewed-on: https://pdfium-review.googlesource.com/19790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-29Read Skia gold json and compare to locally generated pngs.Henrique Nakashima
Change-Id: I73b6a477c1a66beec2b73072f23faab7db7d3342 Reviewed-on: https://pdfium-review.googlesource.com/18513 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-29Fix some nits in FPDFText_GetText().Lei Zhang
Use more variables to avoid redundant calculations. Add one more edge test case. Change-Id: I6c8a0aca9de3bdd1a394c39304fd9a75009f9489 Reviewed-on: https://pdfium-review.googlesource.com/19690 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-29Remove static measurement dataDan Sinclair
This CL removes the static initialized CXFA_Measurement items and replaces them with strings which are converted to measurements at runtime. Bug: pdfium:804 Change-Id: I60422b6ddff750d504a5a8b62de6ad896fc80caf Reviewed-on: https://pdfium-review.googlesource.com/19770 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-29Remove unneded structs from CFX_CTTGSUBTable part 1Nicolas Pena
This CL removes some useless structs from CFX_CTTGSUBTable. Change-Id: Iaf8b58d70b36d77fea73946c6b4279b15f5726e8 Reviewed-on: https://pdfium-review.googlesource.com/19710 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-29Revert "[CFI] Enable type generalization for LCMS"dsinclair
This reverts commit 7829b7048d5cf13a4f1a806fed57f2440d1b5dec. Reason for revert: Breaking the waterfall build. Looks like it's finding a leak it wasn't before? https://build.chromium.org/p/client.pdfium/builders/linux_xfa_asan_lsan/builds/2376/steps/embeddertests/logs/stdio Original change's description: > [CFI] Enable type generalization for LCMS > > Control Flow Integrity [1] indirect call checking verifies that function > pointers only call valid functions with a matching type signature. This > condition can be too strict, a common form of 'abstraction' relies on > function pointers being cast to generalize argument pointer types to > void*. > > In LCMS these failures occur because of casts of function pointers called > as both _cmsInterpFn16 (cmsInterpFunction.Lerp16) and _cmsOPTeval16Fn (as > an argument to _cmsPipelineSetOptimizationParameters) types making it > difficult to refactor out easily. Instead, enabling the type > generalization build config weakens the type checking performed for > CFI-icall to accomodate this common type of casts. > > [1] https://www.chromium.org/developers/testing/control-flow-integrity > > Bug: 785442 > Change-Id: Ib42fb1b4e152d5042b170698c2707ebb9e0cc1ee > Reviewed-on: https://pdfium-review.googlesource.com/19250 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: dsinclair <dsinclair@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org,vtsyrklevich@chromium.org Change-Id: Ib9c26eb017733d2bf02035415221475bfbfe55c9 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 785442 Reviewed-on: https://pdfium-review.googlesource.com/19730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-29[CFI] Enable type generalization for LCMSVlad Tsyrklevich
Control Flow Integrity [1] indirect call checking verifies that function pointers only call valid functions with a matching type signature. This condition can be too strict, a common form of 'abstraction' relies on function pointers being cast to generalize argument pointer types to void*. In LCMS these failures occur because of casts of function pointers called as both _cmsInterpFn16 (cmsInterpFunction.Lerp16) and _cmsOPTeval16Fn (as an argument to _cmsPipelineSetOptimizationParameters) types making it difficult to refactor out easily. Instead, enabling the type generalization build config weakens the type checking performed for CFI-icall to accomodate this common type of casts. [1] https://www.chromium.org/developers/testing/control-flow-integrity Bug: 785442 Change-Id: Ib42fb1b4e152d5042b170698c2707ebb9e0cc1ee Reviewed-on: https://pdfium-review.googlesource.com/19250 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>