summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2014-12-23XFA: merge patch from CL 733693003, getting rid of more castsBruce Dawson
Getting rid of more (FX_LPCWSTR) casts and fixing two bugs revealed by this. Since casts to FX_LPCWSTR have been shown to hide bugs I tried removing more of them, targeting those places where a cast was used to force a conversion from CFX_WideString to FX_LPCWSTR, replacing these casts with calls to the newly added .c_str() function. This revealed two places where the cast was hiding a bug -- where ->c_str() was required instead! This removes ~33 FX_LPCWSTR casts and there are ~31 left, many of which will go away in some future change. Also includes this change: Removing unnecessary casts from wchar_t* to wchar_t*, by various names. Original patch from Bruce Dawson(brucedawson@chromium.org) TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/811593007
2014-12-23XFA: merge patch from CL 731673003, fix incorrect operatorBruce Dawson
Fixing operator so that bCheckRight isn't always true. Unknown effect! VC++'s /analyze points out that this expression: FX_BOOL bCheckRight = type != 'D' || type != 'W';" is always true. This means that the tests for the right edge of a word Original patch from Bruce Dawson(brucedawson@chromium.org) BUG=427616 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/822763003
2014-12-23XFA: merge patch from CL 727083002, zero local variables.Bruce Dawson
Zero initialize ch to avoid possible bug - conditions are very subtle. Whether ch and iRet are read without being initialized depends on complex preconditions and cannot be determined by looking at these function. Therefore it seems prudent to zero initialize them to avoid any risk. BUG=427616 TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/727083002 Review URL: https://codereview.chromium.org/793763005
2014-12-19XFA: merge patch from CL 816153002Bo Xu
Transform font size to user space for valid text size comparison. BUG=438441 R=thestig@chromium.org Review URL: https://codereview.chromium.org/816153002
2014-12-19XFA: merge patch from CL 815103002Bo Xu
Update freetype to 2.5.4. Put freetype into third_party directory, cleaning up header files. Previously freetype header files are in core/src/fxge/freetype and core/include/thirdparties. There were also multiple fx_freetype.h. This patch removes the additional Foxit wrapper to make further update easier. Notice, for original freetype source code, the following files are modified and need to be updated accordingly in future update: third_party/freetype/include/config/ftmodule.h third_party/freetype/include/config/ftoption.h BUG=407341 R=thestig@chromium.org Review URL: https://codereview.chromium.org/815103002
2014-12-19XFA: merge patch from CL 817753002Bo Xu
Fix a few windows compile warnings R=tsepez@chromium.org Review URL: https://codereview.chromium.org/817753002
2014-12-19XFA: merge patch from CL 810223003Lei Zhang
Cleanup: Refactor some code into its own function in fpdf_text_int.cpp. Also use stdlib algorithms in a few places. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/810223003 Conflicts: core/src/fpdftext/fpdf_text_int.cpp
2014-12-19XFA: merge patch from CL 816593002Lei Zhang
Cleanup: Remove a shadow variable in CPDF_TextPage::CloseTempLine(). R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/816593002
2014-12-19XFA: merge patch from CL 761313004Bo Xu
Add a small LRU cache for the JBIG2 symbol dictionary. This reduces rendering time on my test document by over 10 seconds. It is super common for a JBIG2 dictionary to span multiple pages, so we don't want to decode the same dictionary over and over again. Original patch from Jeff Breidenbach (breidenbach@gmail.com) BUG=https://code.google.com/p/pdfium/issues/detail?id=85 R=bo_xu@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/761313004
2014-12-19XFA: merge patch from CL 790213005Lei Zhang
Cleanup: Pass by const reference in fpdftext. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/790213005
2014-12-19XFA: merge patch from CL 441988Bruce Dawson
Avoid duplicate definitions of JSCONST_n*Hash and QeTable variables. QeTable is a 752 byte array that was defined in a header file. This caused it to be instantiated by the VC++ compiler 12 times, wasting 8,272 bytes of space in the data segment. Because 'const' implies 'static' this did not cause any duplicate symbol errors. JSCONST_n*HASH are a set of eight variables that are defined in a header file. This causes them to be replicated 15 times. The variables themselves are tiny but they are dynamically initialized and this dynamic initialization code is replicated 15 times. When tested on pdfium_test.exe the effect of this change is to: Reduce the .text (code) segment by 3,616 bytes. Reduce the .rdata section by 8,656 bytes. Reduce the total binary file size by 13312 bytes. These are the worst offenders for pdf.dll as shown in: https://drive.google.com/open?id=1BvubxoA2SU_2e4T5cq7jHTjc1TlT0qOndpIfX3DMeA8&authuser=0 This will also drastically simplify the list of work to be done for bug 441899 (getting rid of initializers). BUG=441988 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/802013002
2014-12-17XFA: merge patch from issue 803103002JUN FANG
Before this fix, the root will be released when an indirect object has the same object number with the root. However, the root object is loaded when the trailer is parsed. It shall not be updated or replaced anymore. BUG=425040 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/803103002
2014-12-15Remove more defines in XFA branch that aren't used for PDFium.John Abd-El-Malek
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/811493002
2014-12-15XFA: merge patch from issue 801913002 and 804463003John Abd-El-Malek
Simplify PDFium by removing code that's not used in the open source repo. -remove parameter from FPDF_InitLibrary -remove a bunch of ifdefs that are unused Fix build after previous commit. TBR=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/809513002
2014-12-11Merge to XFA: patch from CL 792113003Bo Xu
m_pColorSpace can not be NULL for image object with DCTDecode filter BUG=411842 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/792113003
2014-12-10Merge to XFA: patch from CL 790363002Bo Xu
Do not do strict check of BitsPerComponent for RunLengthDecode filter BUG=438421 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/790363002
2014-12-10Merge to XFA: patch from CL 791223002Bo Xu
Lab colorspace needs to be 3 component BUG=429134 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/791223002
2014-12-09Merge to XFA: patch from CL 787753002Bo Xu
Trailer should be a dictionary object BUG=https://code.google.com/p/pdfium/issues/detail?id=86 a "<<" token should follow "trailer" but "<" will trick the parser to make trailer a hex string object. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/787753002
2014-12-04Remove needless casts of (narrow) string literals.Tom Sepez
Follow-up to work on (wide) string literals. R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/751113003
2014-11-24Merge to XFA: patch from CL 758593002Bo Xu
Update to openjpeg r2944 BUG=429139,430566,431288 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/758593002
2014-11-19Merge to XFA: patch from CL 743263002Jun Fang
Fix blank page issues caused by too strict check Before this fix, PDF parser aborts the parsering process when detecting an error. For this case, PDF parser just gives up parsering when it detects that the length of image stream is incorrect. The solution to this case is to find the tag "endstream" and "endobj" to calculate the length rather than aborting the parsering process. BUG=433339 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/743263002
2014-11-18Merge to XFA: patch from CL 738433003Bruce Dawson
Review URL: https://codereview.chromium.org/738433003 R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/741473003
2014-11-17Merge to XFA: patch from CL 730993002Bo Xu
2014-11-14Merge to XFA: Patch from CL 726143002Bo Xu
BUG=https://code.google.com/p/pdfium/issues/detail?id=78 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/726143002
2014-11-14XFA: merge patch from issue 726033002Tom Sepez
Fixes android build error under stricter compilation modes. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/728943002
2014-11-10Merge to XFA: patch from CL 618073003Bo Xu
BUG=401988 R=vitalybuka@chromium.org Review URL: https://codereview.chromium.org/618073003
2014-11-06Merge to XFA: patch from CL 703213004Tom Sepez
Fix bug with reading from uninitialized variable found by VC++'s /analyze. The flag variable is conditionally initialized but unconditionally read. Warning was: src\fpdfapi\fpdf_page\fpdf_page_pattern.cpp(274) : warning C6001: Using uninitialized memory 'flag'. BUG=427616 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/703213004 Review URL: https://codereview.chromium.org/680173005
2014-11-03Merge XFA to PDFium master at 4dc95e7 on 10/28/2014Bo Xu
2014-10-30Undo an old change in freetype to account for size of USHORTBo Xu
BUG=418582 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/680833006
2014-10-30Update openjpeg to r2920Bo Xu
BUG=414036, 425151 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/688633003
2014-10-29Resolve compilation error with G++ 4.9.Tom Sepez
Add a check for zero-length keys to avoid hitting the equivalent of |""[1]|. BUG=https://code.google.com/p/pdfium/issues/detail?id=58 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/665223003
2014-10-22update openjpeg to r2911Bo Xu
BUG=418976, 425150, 414525 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/671943002
2014-10-21Change the clear order of pDocPage and pDocRenderBo Xu
pTransfer function is released in pDocRender cleanup but is still being accessed in ~CPDF_GeneralStateData in pDocPage cleanup. BUG=419320 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/662063003
2014-10-21Update openjpeg to r2908chromium/2202chromium/2201chromium/2200chromium/2199chromium/2198chromium/2197Bo Xu
BUG=414089, 414310, 414606 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/670813002
2014-10-21More fixes in sycc422_to_rgb and sycc420_to_rgb when image width is oddBo Xu
This patch is supplementary to issue 418881 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/645793007
2014-10-21Add missing parenthesis in FXARGB_GETDIB macroBo Xu
You can get warning when using FXARGB_GETDIB() with & operation in the same statement like: FXARGB_GETDIB(src_scan) & 0xffffff in fx_dib_composite.cpp: ../../third_party/pdfium/core/src/fxge/dib/fx_dib_composite.cpp:737:205: error: '&' within '|' [-Werror,-Wbitwise-op-parentheses] Original patch from jiangj@opera.com R=thakis@chromium.org Review URL: https://codereview.chromium.org/578253002
2014-10-15Fix licenses in headers to pass Chromium's checklicenses tool.chromium/2196chromium/2195chromium/2194chromium/2193chromium/2192chromium/2191Tom Sepez
This is a re-landing of the changes in https://pdfium.googlesource.com/pdfium/+/6387aff which were lost during a libopenjpeg library roll. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/661463003
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-10-14Don't leave dangling pointer to out-of-scope local in ↵Tom Sepez
CPDF_StreamContentParser::Parse. This is just a bit of defensive programming; I'm not sure the situation can occur in the current code, but the following code is likely to set off a red flag to anyone who reads it: CPDF_StreamParser syntax(pData, dwSize); m_pSyntax = &syntax; since the extent of the local |syntax| is far less than the pointer member |m_pSyntax|. NULL it out before syntax goes out of scope. R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/652063002
2014-10-14Glyph index is out of range in cff_get_glyph_name.Jun Fang
Glyph index shall be less than number of glyphs. BUG=418585 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/652363002
2014-10-13Fix off-by-one in sizing of m_EmbeddedToUnicodes.Tom Sepez
BUG=421196 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/656463006
2014-10-10Fix a bug when image width is odd in sycc422_to_rgbBo Xu
BUG=418881 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/648823002
2014-10-03check pointer overflow in t2.cBo Xu
BUG=413375 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/624023003
2014-09-30Update openjpegBo Xu
BUG=407964, 414182, 413447 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/589243004
2014-09-19Fix a bug when assign the generation number of indirect objectschromium/2166chromium/2165Bo Xu
BUG=408532 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/524443002
2014-09-19Adjust the order of clearing resource in CPDF_DocPageData::ClearJun Fang
Images are basic resource and are referred or used by other objects in some cases. Images should be released after the objects who uses these objects. In this case, an image object is accessed in the process of CPDF_TilingPattern's destroy. Unlikely, this image has been destroyed before. BUG=414046 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/582993002
2014-09-18Fix Regression: Incomplete file loading is seen for multi page pdf files.chromium/2164chromium/2163Tom Sepez
This was introduced at PDFium revision 12a9940. There was a subtle logic change for null |parray|. BUG=415438 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/579363002
2014-09-16When forcing clear page data, no need to release colorspace when releasing ↵Bo Xu
pattern BUG=414661 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/572853006
2014-09-15Add a boundary check before accessing the table of 'Index to Location'Jun Fang
Before this fix, only |gindex < face->num_locations| is checked. However, the pointer, p, will be moved to next location in the first FT_NEXT_ULONG or FT_NEXT_USHORT. It may cause a crashier. So a boundary check is needed before the second FT_NEXT_ULONG or FT_NEXT_USHORT. BUG=412457 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/571833002
2014-09-15Check Null pointer in CPDF_Dictionary::GetUnicodeTextBo Xu
BUG=414155 R=thakis@chromium.org Review URL: https://codereview.chromium.org/574463002