summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-06-10Cache the CPDF_Annot's subtype, since it should never changes.Lei Zhang
BUG=495300 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1178513002.
2015-06-10Convert CPDF_PatternMap to std::map.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1162123004.
2015-06-10Cleanup: Remove CFFL_IFormFiller::GetCommitKey() that always returns 0.Lei Zhang
Remove callers and related code that all just pass zeros around. Also remove CFFL_IFormFiller::GetKeyDown(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1149623012.
2015-06-10Convert CPDF_ColorSpaceMap to std::map.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1154963003.
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-10Convert CPDF_FontMap to std::map.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1151133004.
2015-06-09Revert 'Correct unexpected hinting fonts'JUN FANG
TBR=tsepez@chromium.org BUG=N/A Review URL: https://codereview.chromium.org/1174583003
2015-06-09Correct unexpected hinting fontsJUN FANG
If the font is 'tricky', it needs to be hinted by default according to the description in freetype. BUG=490814 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1170313003
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-06-08Remove more cruft from fx_system.hTom Sepez
- include system headers first and alphabetize. - remove unsupported FX_WIN32_MOBILE symbol. - actually define a FX_WIN64 symbol and make consistent. - use final/override, not FX_FINAL. - let stdint.h resolve FX_WORDSIZE concerns. - unused FX_ERR and FX_SUCCESS() macros. - unused FX_LSB_FIRST macro. - outline FX type deprecation plan. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1169963003
2015-06-08Fix potentially massive memory leak in CPDF_DIBSource::LoadJpxBitmap().chromium/2429chromium/2428chromium/2427Lei Zhang
Leaks can happen in several places. For this particular bug, it happens when there is a colorspace component count mismatch. BUG=497191 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1153633009
2015-06-05Cleanup: Make CPDF_Annot::m_pAnnotDict private.Lei Zhang
Remove dead code in CPDF_Annot as well. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1157773012
2015-06-05Add move constructor for FX string types.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1162203007
2015-06-05Standalone checkout gets buildtools.Tom Sepez
This will pull in the checkdeps utility for standalone builds. Write some include rules, too. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1149623011
2015-06-05Fix bad include path in fpdfview.cppTom Sepez
Caught by checkdeps rules. That this still compiled is probably due to some stray -I flag somewhere. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1149213008
2015-06-04Move fx_safe_types.h to include/ directory.Tom Sepez
Small bit of OCD here, since this file is included cross-library (i.e. from fpdfsk), it can't be in src/. In other words, the following should be empty: grep -R 'include.*core/src/' fpdfsdk Fix some IWYU in it at the same time. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1147353006
2015-06-03Kill unused IPDF_ classes.Tom Sepez
Some are simply never defined. Some are never instantiated. Some have paths that are never reached. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1168503003
2015-06-03Fix fx_basic_memmgr_unittest.cpp under stricter GN ruleschromium/2426chromium/2425chromium/2424chromium/2423chromium/2422Tom Sepez
This caused a revert of the PDFium roll. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1165863003
2015-06-02Automated test case for 487928.Tom Sepez
Reproducing this bug requires the embedder to fire timers, something the single-pass pdfium-test binary doesn't do properly at the present. So we modify the embedder test delegate to allow the immediate triggering of the same. Perform some cleanup along the way by removing EmbedderTestDefaultDelegate -- it buys us nothing over the the no-op one. And, of course, v8 initialization is busted again, and we need v8 here. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1153213004
2015-06-02Fix windows compile: fix size_t vs. int mismatchTom Sepez
As indicated by: http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/63417/steps/compile%20%28with%20patch%29/logs/stdio R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1160293003
2015-06-02kill IPDF_DocParser().Tom Sepez
Its fine to program to interfaces, but since the sole concrete implementation is in the same header as the interface, the code is bypassing it anyways. We can de-virtualize some things along the way, and remove two non-existent function prototypes from one of the headers. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1158053003
2015-06-02Fix heap use after free in Document::DoFieldDelay and Document::delayTom Sepez
This fix removes CJS_DelayData object from m_DelayData array and copies them to a new array, before processing them. So contents of m_DelayData array cannot be used after they get freed. BUG=487928 R=tsepez@chromium.org TEST= Chrome pdf plugin should not crash when poc_stable,testuafdocument1.pdf and testuafdocument2.pdf are viewed. see crbug.com/487928 and crbug.com/487928#c18 for more details. Review URL: https://codereview.chromium.org/1163823002
2015-06-01Add missing comma to third_party.gypBruce Dawson
A reference to nonstd_unique_ptr.h was added with https://codereview.chromium.org/1091283002 but a comma is missing after it. This causes this string to be concatenated with the next, leading to broken sources. This went unnoticed by the build due to the fact that the affected sources are both headers, but they should be properly separated. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1156663006
2015-05-29Run V8 in predictable mode for pdfium_testJochen Eisinger
This won't post tasks to the background threads BUG=none R=kcc@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1157123003
2015-05-28Fix suppressions for 2015-05-28 dropTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1154993003
2015-05-28Roll DEPS to pick up 2015-05-28 corpus drop.Tom Sepez
This will undoubtedly RED the tree due to differences in platforms and environments. A subsequent CL will add suppressions to get back to GREEN. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1153393004
2015-05-28Fix ALL the include guards.Tom Sepez
Get rid of leading _CAPITAL identifiers. A large number of these didn't actually match the filename. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1160443004
2015-05-27Remove rendundant ../include from paths of files in include/ directoryTom Sepez
Tiny bit of tidying I noticed while trying to figure out include rules. In other words, cd core/include git grep 'include.*include' git grep 'include.*src' Should produce no output, and cd fpdfsdk/include git grep 'include.*include' | grep -v ../core/include git grep 'include.*src' Should produce no output as well. Fix some IWYU, header guards, include ordering, whitespace along the way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1162453003
2015-05-26Upgrade openjpeg to r3002JUN FANG
BUG=459215 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1160663002
2015-05-21Update copy of safe_math_impl.h to take a fix from upstream:Tom Sepez
Fix a division by zero when multiplying 0 * y with SafeNumerics. BUG=488302 R=jschuh@chromium.org Review URL: https://codereview.chromium.org/1126243007
2015-05-21Fix four annoying warnings:Tom Sepez
Two "set but unused", one of which is surely an artifact from copying code around, and the other which ought to be used for the sake of clarity. Two are unknown "optimize" pragmas, remove them since the code has been shipped for years on other platforms under full optimization. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1148353002
2015-05-21Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBufferJUN FANG
This issue is trigged by the conversion from unsigned int to signed int. A large unsigned int is converted to int. It's represented as a negative int which is used in the condition of while later. BUG=482639 R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1146913003
2015-05-20Get test running scripts to detect and report common error.Bruce Dawson
testing/tools/run_corpus_tests.py assumes a debug build and will fail cryptically if only a release build is available. Arguably there shouldn't be a default because having one could lead to accidentally running a stale version, but that is probably too much of a change. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1150823003
2015-05-20Integer overflow in CJBig2_Image::expandJUN FANG
1. New size should be larger than old size in JBig2_Realloc. 2. Arguments are integers but parameters are size_t in JBIG2_memset. After integer overflows, it will be presented as a huge unsigned number on 64 bits system. BUG=483981 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1148643002
2015-05-20Tidy public fpdfview.h and fpdf_flatten.h.Tom Sepez
Mostly cosmetic; fix a spelling error, make comment style consistent, remove unnecessary #ifdefs, remove unused globals. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1139993003
2015-05-20Turn on warnings for usage of disabled V8 APIsJochen Eisinger
R=vogelheim@chromium.org BUG= Review URL: https://codereview.chromium.org/1146933002
2015-05-19Re-land: Remove FX_Alloc() null checks now that it can't return NULL.Tom Sepez
Fixes the ordering of some assignments broken when converting to checked numerics in CFX_PathData::AddPointCount(). Original Review URL: https://codereview.chromium.org/1142713005 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135893008
2015-05-19Revert "Remove FX_Alloc() null checks now that it can't return NULL."Tom Sepez
This reverts commit eb6527763171cdb4b0fbfea5a20d691f4d67b660. Reason for revert: broke javascript tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1145843005
2015-05-19Remove FX_Alloc() null checks now that it can't return NULL.Tom Sepez
This permits some functions to become void's since they, in turn, can't fail. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1142713005
2015-05-19Fix Heap Overflow in CJBig2_Image::expandJUN FANG
Integer overflow in CJBig2_Image::expand. It causes the size of reallocated is not expected. BUG=483981 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1131023008
2015-05-18Cleanup if early return from opj_j2k_copy_default_tcp_and_create_tcd().Tom Sepez
The opj_j2k_copy_default_tcp_and_create_tcp() function memcpy's a top-level struct, and then replaces pointers to memory owned by the original struct with new blocks of memory. Unfortunately, an early return can leave the copy with pointers to memory it doesn't own, which causes problems when cleaning up the partially-initialized struct. The referenced bug is triggered when we get a return at original line 7969 or 7385 due to OOM. Moral of the story: creating a "copy constructor" equivalent based on memcpy() instead of copying field by field for structs containing pointers is usually a bad idea. BUG=486538 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1138033007
2015-05-19Replace v8::Handle with v8::Local and v8::Persistent with v8::GlobalJochen Eisinger
those types are just aliases, and we should consistently use the new version R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1138823004
2015-05-18Change FX_Alloc to FX_Try_Alloc in _JpegEncodeJUN FANG
This CL is used for: 1. keeping the same logic as before (the behaviour of FX_Alloc was changed for OOM). 2. fixing a potential integer overflow. BUG=N/A R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1126013006
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-05-17Add myself to OWNERS fileJochen Eisinger
R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1133333005
2015-05-17Replace deprecated with non-deprecated V8 APIsJochen Eisinger
In most cases, we just CHECK() that no exception was thrown. Previously, we'd just crash. Ideally, this should all be fixed and the system should cope with those exceptions, but that's beyond this CL. R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1126203010
2015-05-15Fix leaks in embedder test's FlateEncode() usage and in FlateEncode().Lei Zhang
For FlateEncode(), error handling code leaked memory. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1144603002
2015-05-15Disable allocation tests that hose the bot.Tom Sepez
Triggering allocation failure can be ... slow. See http://build.chromium.org/p/client.pdfium/builders/win/builds/126 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1142463005
2015-05-15Initialize members of CPDF_TextPageFind class.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1137933004
2015-05-15Fix leaks in the embedder tests themselves.Lei Zhang
Also change EmbedderTest::TearDown() to match the destruction order in Chromium's PDF code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1138143003