summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
AgeCommit message (Collapse)Author
2015-07-23FX_BOOL considered harmful, part 2.Tom Sepez
Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 .
2015-07-22Re-land else-after-returnsTom Sepez
Revert "Revert "Fix else-after-returns throughout pdfium."" This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d. Fix one naming conflict. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243953004 .
2015-07-22Revert "Fix else-after-returns throughout pdfium."Tom Sepez
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
2015-07-22Fix else-after-returns throughout pdfium.Tom Sepez
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
2015-07-15Add a null pointer check to CPDF_CalRGB::v_Load().Lei Zhang
BUG=492055 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1241923005 .
2015-07-01Revert "Revert "Redo range check in CPDF_SampledFunc::v_Call().""Tom Sepez
This reverts commit 327080bacabb3d90094144e66ae57037d4a8d8e6. This re-lands the patch, but removes the tests which would require 512MB buffers to be reliably allocatable on small bots. It also adds small fixes accumulated while diagnosing it. R=sanqingsong@gmail.com Review URL: https://codereview.chromium.org/1214403002.
2015-06-19Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
2015-06-18Fix CPDF_ICCBasedCS::GetDefaultValue heap-buffer-overflow.Tom Sepez
Introduced in ea44bd0. Re-animating the dead (code) usually turns out badly, and this is no exception. Make both of the uncallable methods go away. BUG=501889 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1179773007.
2015-06-16Add constructor for CPDF_ColorSpace.Tom Sepez
Prevents sub-classes from tweaking parent class instance vars. Also "fix" https://code.google.com/p/pdfium/issues/detail?id=170, assuming 0 is a good value. BUG=pdfium:170 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1185903002.
2015-06-15Provide a constructor for CPDF_CountedObject.Tom Sepez
Make members protected and remove external manipulations. Move "*" into template since its always an indirection. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1182903002.
2015-06-11Remove trailing whitespaces in core.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1177973008.
2015-06-11Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
At one point in time, it may have made sense to indicate the expected alignment of the memory you're about to copy, but that was last century. The compiler will take care of it just fine. I stopped short of removing the FXSYS_ wrapper macros entirely. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1179693003.
2015-06-10Convert CPDF_ImageMap to std::map.Lei Zhang
Also simplify CPDF_DocPageData::ReleaseIccProfile() since its first argument is always null. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1149273004.
2015-06-10Remove typdefs for pointer types in fx_system.h.Tom Sepez
This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003
2015-06-09Use stdint.h types throughout PDFium.Tom Sepez
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
2015-05-18Add safe FX_Alloc2D() macroTom Sepez
This avoids unchecked multiplications when computing a size argument to malloc(). Such an overflow is very scary, and can result in exploitable bugs. Along the way, kill off some return checks, since we know this can't return NULL. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1143663004
2015-04-27SEGV in CFX_BaseSegmentedArray::Iterate() when CS has malformed dictionary.Tom Sepez
Failure to check document-controlled value before using it. BUG=481363 R=palmer@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1110653002
2015-04-16Replace FX_NEW with new, remove tests from fpdfapiTom Sepez
Very few places where a change is required, but remove FX_NEW to show they've been audited. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1075953004
2015-03-17Revert "Fix a problem that JP2 image is not displayed because index color ↵Tom Sepez
space is used" This reverts commit 5a0e504d53195892458d819e52c62bea0c710bd5. Original review URL https://codereview.chromium.org/1009513003 Reason for revert: New "corpus" tests show that this is no longer rendering some images. See, e.g. http://chromegw/i/client.pdfium/builders/linux/builds/144/steps/corpus%20tests/logs/stdio for those that diff'd. TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1016823003
2015-03-16Fix a problem that JP2 image is not displayed because index color space is usedJUN FANG
There are two issues in this bug. One is that JP2 image is not displayed because it aborts loading Jpx bitmap when the number of components in color space is different with that one in JPX images. I found that the number of components in color space isn't updated after it's initialized. For index color space, the component shall inherit from its base color space. The second issue is that displayed color is not correct after I fixed the first issue. The root cause is that sRGB is used in JPX image, it doesn't need to map from index to RGB again. BUG=464215 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1009513003
2015-01-05Cleanup: Get rid of CRLF line endings.Lei Zhang
R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/837533003
2014-12-10Lab colorspace needs to be 3 componentBo Xu
BUG=429134 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/791223002
2014-10-14Store the address of the page data map's value for proper referencing.Bo Xu
CPDF_Pattern objects are counted and maintained in m_PatternedMap. When a CPDF_Pattern object "pattern" is deleted, it's address is marked as NULL in m_PatternMap. This patch stores the address of CPDF_Pattern's adderss in all objects that references "pattern", to ensure valid referencing after deletion. BUG=416319, 419976, 418392 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/656753002
2014-09-09Change the forced clear order of CPDF_DocPageData::Clear, and remove ↵Bo Xu
m_pDocument in CPDF_Color If not forced clear, the counter of CPDF_Pattern will take care the count of referenced instance. When forced clear, clear color first to make sure pattern still exists when referencing it. BUG=411154 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/554913003
2014-09-02Add m_pDocument in CPDF_Color and check if page date has been forced clearBo Xu
This will prevent using freed pattern object. This is a better solution than https://pdfium.googlesource.com/pdfium/+/1b9c5c4dc41956b8c5ab17b9a882adf8a2513768 and in essence revert that patch BUG=409373 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/522483003
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/503883002
2014-08-25Revert of Use number of components from ICC profile and alternateCS ↵Bo Xu
(patchset #1 of https://codereview.chromium.org/493163003/) Reason for revert: Needs to address comments before landing Original issue's description: > Use number of components from ICC profile and alternate color space > > BUG=406806 > > Committed: https://pdfium.googlesource.com/pdfium/+/be83103 TBR=tsepez@chromium.org,jun_fang@foxitsoftware.com NOTREECHECKS=true NOTRY=true BUG=406806 Review URL: https://codereview.chromium.org/504883003
2014-08-25Use number of components from ICC profile and alternate color spaceBo Xu
BUG=406806 Review URL: https://codereview.chromium.org/493163003
2014-08-22Check the number of component in ICCBased colorspaceBo Xu
From PDF reference 8.6.5.5, this could only be 1, 3 or 4. BUG=387968 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/464083003
2014-08-21For pattern colorspace, its base colorspace should not be a pattern colorspaceBo Xu
BUG=405588 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/496883002
2014-08-18Add a null pointer check before getting the family name of the given color ↵Jun Fang
space in CPDF_ColorSpace::Load The test file defines a wrong color space object (7 0 obj). In the content of 7 0 obj, the reserved obj (0 0 R) is used. The process of loading color space returns NULL when the reserved obj (0 0 R) is found. For the error color space, it only needs to return NULL when an error is detected. BUG=403032 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/477413002
2014-08-18No need to release m_pBaseCS in CPDF_IndexedCS and CPDF_PatternCSBo Xu
m_pBaseCS will be released in CPDF_DocPageData::Clear. BUG=401372 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/472653002
2014-08-12For a CPDF_Color object, when set a new pattern to it, disconnect its link ↵Bo Xu
with the old pattern This patch is related to https://pdfium.googlesource.com/pdfium/+/1b9c5c4dc41956b8c5ab17b9a882adf8a2513768 BUG=402260 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/460383004
2014-08-05The root cause of this issue is shown as below:Jun Fang
Patterns are managed in CPDF_DocPageData. When a document is closed, all patterns will be released in the deconstruction of CPDF_DocPageData. However, some patterns which are referenced in CPDF_Color can't get the notification from the destroy of CPDF_DocPageData. It will cause use-after-free in CPDF_Color::~CPDF_Color. BUG=392719 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/439693002
2014-07-29Fix a few more warnings in chromium_code mode.Nico Weber
No intended behavior change. - Remove more unused variables, functions, member variables. - Put a few constructor initializers in the order they execute in. - Add braces for subobject initializers. - Fix a handful of signed / unsigned comparisons. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/429593005
2014-07-24CalRGB color correctionBo Xu
BUG=pdfium:19 R=thestig@chromium.org Review URL: https://codereview.chromium.org/403163002
2014-07-15Error handling for invalid component number in CPDF_ICCBasedCS::v_LoadJun Fang
BUG=386728 R=palmer@chromium.org Review URL: https://codereview.chromium.org/397803002
2014-07-14Fix uninitialized nresults in GetRGBJun Fang
BUG=387809 R=palmer@chromium.org Review URL: https://codereview.chromium.org/379283003
2014-07-08Remove custom memory managerBo Xu
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
2014-07-07Fix uninitialized nresults and RGBfoxit
BUG=387785 R=palmer@chromium.org Review URL: https://codereview.chromium.org/362403002
2014-07-07Fix uninitialized RGB in GetRGBfoxit
BUG=386729 R=palmer@chromium.org Review URL: https://codereview.chromium.org/366803003
2014-06-30Remove "this==NULL" and adjust corresponding callersBo Xu
BUG= R=thakis@chromium.org Review URL: https://codereview.chromium.org/361553002
2014-06-20Stack-buffer-overflow in IccLib_Translatefoxit
BUG=382240 R=palmer@chromium.org Review URL: https://codereview.chromium.org/332143002
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek