summaryrefslogtreecommitdiff
path: root/core/src
AgeCommit message (Collapse)Author
2015-11-06Merge to M46: Enforce input and output dimensionalities for CPDF_StitchFunc.chromium/2490Oliver Chang
Also cleans up some places in the relevant functions since we're here. BUG=551460 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1421783004 . (cherry picked from commit 4f85605cbc652a17bc833f883186e0a68af6006d) Review URL: https://codereview.chromium.org/1432833002 .
2015-10-19Merge to M46: upgrade openjpeg to commit# cf352afLei Zhang
BUG=457480,497355 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1338973005 . (cherry picked from commit c212b684cb028a5d98e57f711c9eed931b853a44) Review URL: https://codereview.chromium.org/1416783002 .
2015-10-19Merge to M46: Loosen checking on the bytes following 'stream'Lei Zhang
PDF specs say that end of line markers shall follow the keyword "stream". But a white space before end of line markers follows this keyword in the test pdf files. BUG=543018 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1401923005 . (cherry picked from commit b5cbfb4cd12b6499912367f9a1e11c666157acb8) Review URL: https://codereview.chromium.org/1417623002 .
2015-10-14Merge to M46: Fix a compiling error on MacLei Zhang
BUG=497357 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1395493003 . (cherry picked from commit 3ea79bbba24a1c0918ea42368e746097dab40663) Review URL: https://codereview.chromium.org/1405903002 .
2015-10-14Merge to M46: Fix heap-buffer-overflow in color_sycc_to_rgbLei Zhang
It's a bug existing in the conversion from YUV420 to RGB. For YUV 420 format, four pixels have 4 Y but only one U and one V. In some cases, there are odd columns or lines in some images. The pixels on last line or column may have Y but no U or V data. For this case, We shall extend U or V using the data on previous column or line. BUG=497357 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1342683002 . (cherry picked from commit f1f19f1fff801c9970af627e050becc2f13f82e7) Review URL: https://codereview.chromium.org/1399323006 .
2015-10-08Merge to M46: Relax the check on 0 length streams.Lei Zhang
CPDF_SyntaxParser::ReadStream() originally created stream objects when the length is 0. Commit 2526930 tightened the constraint and returned NULL. This has some adverse affects, as seen in Chromium's print preview of PDFs. Instead, relax the constraint a little so when the length is 0, return a CPDF_Stream with NULL data and size 0. BUG=531835 Review URL: https://codereview.chromium.org/1394743002 . (cherry picked from commit 4fa0e27ba39f49ba92fb4c160ab836a6f1dd2893) Review URL: https://codereview.chromium.org/1396883002 .
2015-09-29Merge to M46: Fix blank page issue caused by too strict correction on bpcLei Zhang
For bit per component (bpc), PDF spec mentions that a RunLengthDecode or DCTDecode filter shall always deliver 8-bit samples. However, some PDF files don't follow this rule. We can find that filter is RunLengthDecode but bpc is 1 in the provided test file. In this case, pdfium will correct bpc to 8 but the actual bpc is 1. It causes a failure because the data is much more than the expected. To handle this case, pdfium doesn't correct bpc to 8 when the original bpc is 1. BUG=512557 R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1328213002 . (cherry picked from commit 3500e90e9e42fa84dd6f07da16cfcf197ec98283) Review URL: https://codereview.chromium.org/1377943002 .
2015-09-28Merge to XFA: Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf filesLei Zhang
Pdfium swallows 'fi' or 'ff' in some tested files because it doesn't load the embedded font file correctly. The root cause is that there is incorrect keyword like 'ngendstream' in the stream of the embedded font file. Pdfium tries to find another correct keyword but uses wrong offset rather than accumulated offset. BUG=524043 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1307353005 . (cherry picked from commit 9bd18183ba8210c91d71c3060146235750a4c71c) Review URL: https://codereview.chromium.org/1374783002 .
2015-09-08Merge to M46: Turn a failing assert into an actual check.Lei Zhang
BUG=522131 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1327913002 . (cherry picked from commit 640c395fa9b76552383ccd0c5f4668ea698089f6) Review URL: https://codereview.chromium.org/1310333007 .
2015-08-18Fix mac build after commit e1ce94e.chromium/2497chromium/2496chromium/2495chromium/2494chromium/2493chromium/2492chromium/2491chromium/2489chromium/2488Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297303002 .
2015-08-18Cleanup CFX_Font a bit.Lei Zhang
- Make methods const. - Make variables non-public. - Remove LoadFile() method. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1293973002 .
2015-08-18Remove unused code warnings found by clang.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297593005 .
2015-08-18FX_CMapDwordToDword considered harmful.Tom Sepez
Lookups are log(n), but random insertions could result in n^2 behaviour. Replace with maps and sets. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1289703003 .
2015-08-18Remove more dead code from fx_basic.hTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1294683003 .
2015-08-17Clean up IFX_BidiCharLei Zhang
- Replace IFX_BidiChar with just CFX_BidiChar - Document implementation - Change out parameters to pointers - Remove dead code - Add an enum for bidi directions - Move several externs to a header - Add unit tests R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1197643002 .
2015-08-17Fix fix fix fix of breakage on mac.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1296383004 .
2015-08-17Fix fix fix of mac build breakage at 9cf44c2eTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1296403002 .
2015-08-17Fix fix of mac build breakage at 2a2a6aaTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1293153003 .
2015-08-17Fix mac build breakage at ce4ffb8.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1287053006 .
2015-08-17CFX_MapByteStringToPtr considered harmful.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1297723002 .
2015-08-17Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1296753003 .
2015-08-17Fix more sign comparison errors.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1290383003 .
2015-08-16Fix -Wunused-function warnings on Windows.Nico Weber
BUG=505316 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1293033002 .
2015-08-14Clean: Fix some unneeded semi-colons and bad spacing.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1284193005 .
2015-08-14Add new public APIs to find the z-order for links and widgets.chromium/2485chromium/2484Lei Zhang
- Implement FPDFLink_GetLinkZOrderAtPoint(). - Implement FPDFPage_FormFieldZOrderAtPoint(). - Mark FPDPage_HasFormFieldAtPoint() as deprecated. - Modify CPDF_LinkList and CPDF_InterForm to support new APIs. - Clean up dead code in CPDF_LinkList and CPDF_InterForm. BUG=chromium:515837 R=jun_fang@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/1278053004 .
2015-08-14Don't bother checking pointers before delete[] and FX_Free().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 .
2015-08-14Use override in more classes in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 .
2015-08-14Cleanup: Remove unused CPDF_Metadata::m_pDoc.Lei Zhang
Also remove unused kAddinNameCJK variable. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1296513003 .
2015-08-14CPDF_ModuleMgr::m_SecurityHandlerMap only used by dead code.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1289693008 .
2015-08-13Fix build after commit 22ece1a. Too many if's.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1294723002 .
2015-08-13Remove last uses of FOXIT_CHROME_BUILD.Lei Zhang
BUG=pdfium:46 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1294693002 .
2015-08-13Cleanup: s/Torelance/Tolerance/Lei Zhang
R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1294713002 .
2015-08-13OutputText() is dead code.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1291213003 .
2015-08-13Cleanup: Remove unused CPDF_Stream::Clone().Lei Zhang
Cloning a CPDF_Stream actually happens via CPDF_Object::Clone(). Transitively, remove: - GetStreamFilter() -- all the filters. R=jam@chromium.org Review URL: https://codereview.chromium.org/1288543002 .
2015-08-13Remove if checks after new.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287863002 .
2015-08-13Allow external font-path configuration from pdfium_test.Tom Sepez
R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/d8b5e73d8609b74e6a995ee1768d20d47bd4b089 Review URL: https://codereview.chromium.org/1268323004 .
2015-08-13Revert "Allow external font-path configuration from pdfium_test."Tom Sepez
This reverts commit d8b5e73d8609b74e6a995ee1768d20d47bd4b089. Broke corpus tests TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1292153002 .
2015-08-13Allow external font-path configuration from pdfium_test.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1268323004 .
2015-08-11Fix a small leak in CPDF_DataAvail::CheckTrailer().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1278713003 .
2015-08-11Remove dead code from CPDF_Metadata. Add missing nullptr check.Lei Zhang
BUG=pdfium:117 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1282653002 .
2015-08-10Cleanup: Mark methods with the override keyword.chromium/2483chromium/2482chromium/2481chromium/2480chromium/2479Lei Zhang
- Delete unneeded CFFL_ComboBox::CanCopy() and friends. - Delete unneeded CFFL_FormFiller::CanCopy() and friends. - Delete unneeded CFFL_TextField::CanCopy() and friends. - Delete unneeded FormFiller::DoCopy() and friends. - Rename CFFL_FormFiller::On{Set,Kill}Focus to avoid conflicts. BUG=pdfium:185 R=thakis@chromium.org Review URL: https://codereview.chromium.org/1283493004 .
2015-08-07Really Really fix tests broken at 9778206.Tom Sepez
Stub out failing platform entirely TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1276333006 .
2015-08-07Really fix tests broken at 9778206.Tom Sepez
Stub out failing platform. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1280043005 .
2015-08-07Fix win unit tests broken at 9778206.Tom Sepez
Windows uses the system implementation of itoa which goes to 36. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1285433002 .
2015-08-07Fix FXSYS_itoa() implementation.Tom Sepez
I thought about removing it, but decided to fix it instead until c++11 hits and there may be better alternatives. Remove unused variants. BUG=517854 R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1274423003 .
2015-08-06clang-format all pdfium code, again.Nico Weber
Also add a presubmit that checks for this so I don't have to keep doing it. No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i BUG=none R=thestig@chromium.org Review URL: https://codereview.chromium.org/1272653005 .
2015-08-06Add CFX_FontFaceInfo constructor.chromium/2478chromium/2477chromium/2476chromium/2475Tom Sepez
(Having renamed CFontFaceInfo to follow naming pattern). Also cleanup some initialization-order noise in CFX_FontMapper. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1277883004 .
2015-08-05Early object closing in PDF via premature 'endobj' keywordJUN FANG
Adobe acrobat defines keywords "\nendstream\n" and "\nendobj\n" in object's stream. However, Pdfium searches "endstream" and "endobj" as the keywords in the streams of objects. Some words like "(endstream)" are wrongly treated as keywords in pdfium. This fix follows Adobe's solution. BUG=493126 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1219133005 .
2015-08-05Remove the unused IFX_StreamRead::SetRange() mechanism.Tom Sepez
This, in turn make m_bUseRange always false, so remove it. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1274883002 .
2015-08-05CPDF_Parser shouldnt be in the business of opening filesTom Sepez
Move that operation closer to the embedder's call. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1269073003 .