pdfium.git
5 years agoRemove CPDFSDK_Annot::ResetAppearance().
Nico Weber [Thu, 31 Jul 2014 17:00:12 +0000]
Remove CPDFSDK_Annot::ResetAppearance().

It's unused, and it caused a warning about CPDFSDK_Widget::ResetAppearance()
failing to override it (since these two unrelated methods had the same name).

No intended behavior change.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/429483004

5 years agoFix integer overflow when stretch bitmap
Bo Xu [Thu, 31 Jul 2014 16:55:36 +0000]
Fix integer overflow when stretch bitmap

When an image object is zoomed in by a big factor, the scaling factor in the transformation matrix is big as well, resulting in a large |dest_width| and |dest_height| value(they can be think of as the equivalent pixel size of the entire image, although most of it is outside the device).

BUG=395636
R=vitalybuka@chromium.org

Review URL: https://codereview.chromium.org/432543002

5 years agoFix uninitialized coords and one of infinite loops
JUN FANG [Thu, 31 Jul 2014 06:12:56 +0000]
Fix uninitialized coords and one of infinite loops

BUG=387854
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/372453005

5 years agoRemove a few unused variables, functions, and member variables.
Nico Weber [Thu, 31 Jul 2014 02:00:31 +0000]
Remove a few unused variables, functions, and member variables.

No intended behavior change.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/426763003

5 years agoFix a few -Wreorder warnings.
Nico Weber [Thu, 31 Jul 2014 01:59:57 +0000]
Fix a few -Wreorder warnings.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/427353003

5 years agoAdd missing braces for aggregate initializers.
Nico Weber [Thu, 31 Jul 2014 01:59:36 +0000]
Add missing braces for aggregate initializers.

No intended behavior change.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/426763004

5 years agoFix potential integer overflow in fpdf_render_loadimage.cpp
JUN FANG [Wed, 30 Jul 2014 22:45:33 +0000]
Fix potential integer overflow in fpdf_render_loadimage.cpp

BUG=391929
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/419693003

5 years agoAttempt to fix some -Woverloaded-virtual warnings.
Nico Weber [Wed, 30 Jul 2014 21:17:19 +0000]
Attempt to fix some -Woverloaded-virtual warnings.

There are many warnings that look like:

error: 'CPWL_RadioButton::OnChar' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
        virtual FX_BOOL                         OnChar(FX_WORD nChar);
                                                ^
note: hidden overloaded virtual function 'CPWL_Wnd::OnChar' declared here: different number of parameters (2 vs 1)
        virtual FX_BOOL                                 OnChar(FX_WORD nChar, FX_DWORD nFlag);
                                                        ^

It looks like someone added the nFlag parameter to the methods in CPWL_Wnd
at some point and missed to update all overloads This patch attempts to fix this:
It adds the parameter to all methods that look like they're trying to overload the base
class method, and renames the method in one case where it fairly clearly looks like
that it's not supposed to be an overload.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/416383004

5 years agoFix incorrect override of GetLayoutOrder().
Nico Weber [Wed, 30 Jul 2014 21:16:25 +0000]
Fix incorrect override of GetLayoutOrder().

fsdk_baseform.h:63:19: error: 'CPDFSDK_Widget::GetLayoutOrder' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
        virtual int                                             GetLayoutOrder() {return 2;}
                                                                ^
fsdk_baseannot.h:70:18: note: hidden overloaded virtual function 'CPDFSDK_Annot::GetLayoutOrder' declared here: different qualifiers (const vs none)
        virtual int                                     GetLayoutOrder() const { return 5; }
                                                        ^

On Windows, I believe MSVS treats these as override since it's such a common and
easy mistake, but clang and gcc do what the standard specifies. Add a "const" to
the function in the subclass so that this is actually an override, as intended.

BUG=pdfium:29
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/427173002

5 years agoFix the potential integer overflow from 'offset+size' in extension.h and fpdfview.cpp
JUN FANG [Wed, 30 Jul 2014 20:46:39 +0000]
Fix the potential integer overflow from 'offset+size' in extension.h and fpdfview.cpp

BUG=397258
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/419063002

5 years agoSpeculative fix for uninitialized value in CFX_ByteString().
Tom Sepez [Wed, 30 Jul 2014 20:03:52 +0000]
Speculative fix for uninitialized value in CFX_ByteString().

If somehow different length values could be obtained by two successive calls
to Doc_getFilePath() (and FieldBrowse() for that matter), and the method is
true to the API documentation that says "The return value always indicated
number of bytes required for the buffer, even when there is no buffer
specified, or the buffer size is less then required", then it is possible
to get a returned length describing memory beyond the current buffer.

We can make the corresponding JS_docGetFilePath() method more robust against
this case by applying better checks to the returned value.

This probably is unrelated since ASAN seems to be flagging the corresponding bug
as UAF, but doesn't hurt to make things more robust.

BUG=392956
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/423233002

5 years agoFix the typo of "Resources" keyword
Bo Xu [Tue, 29 Jul 2014 13:38:16 +0000]
Fix the typo of "Resources" keyword

BUG=None
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/420793004

5 years agoTidy up app::response().
Tom Sepez [Tue, 29 Jul 2014 21:01:21 +0000]
Tidy up app::response().

Follow-up from https://codereview.chromium.org/424883002/

- Remove some stray whitespace.
- Fix "else after return".
- Remove unused swResponse local.
- Treat unexpectedly large responses as errors.

BUG=
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/423953002

5 years agoFix a few more warnings in chromium_code mode.
Nico Weber [Tue, 29 Jul 2014 17:13:17 +0000]
Fix a few more warnings in chromium_code mode.

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

5 years agoRemove a few unused variables, functions, and tables.
Nico Weber [Tue, 29 Jul 2014 15:55:54 +0000]
Remove a few unused variables, functions, and tables.

Found by clang's -Wunused-variable, -Wunused-function, -Wunused-const-variable.

BUG=none
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/404653005

5 years agoRemove 'inline' from two methods.
Nico Weber [Mon, 28 Jul 2014 22:23:04 +0000]
Remove 'inline' from two methods.

The methods are only defined in the cpp and thus can't always be inlined,
the methods are virtual and so can only be inlined when the concrete type
is known, and inline functions need their definition available in all
translation units.

So just remove the 'inline'.

BUG=none
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/409253004

5 years agoCalRGB color correction
Bo Xu [Fri, 25 Jul 2014 00:50:59 +0000]
CalRGB color correction

BUG=pdfium:19
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/403163002

5 years agoThis change is for fixing the potential integer overflow from "offset + size"
JUN FANG [Thu, 24 Jul 2014 19:19:57 +0000]
This change is for fixing the potential integer overflow from "offset + size"

BUG=382667
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/322333002

5 years agoRefactor CFX_BasicArray.
Chris Palmer [Wed, 23 Jul 2014 22:00:32 +0000]
Refactor CFX_BasicArray.

The |nGrowBy| argument to |SetSize| was always -1, which caused the
effective m_nGrowBy value to always be its default value: 0. So it was not
needed, and was cluttering up the logic.

BUG=384662

Check for integer overflow in CFX_BasicArray.

BUG=384662
R=bo_xu@foxitsoftware.com, rsesek@chromium.org

Review URL: https://codereview.chromium.org/415803002

5 years agoCheck for integer overflow in CFX_BasicArray.
Chris Palmer [Wed, 23 Jul 2014 21:56:29 +0000]
Check for integer overflow in CFX_BasicArray.

BUG=384662
R=bo_xu@foxitsoftware.com, rsesek@chromium.org

Review URL: https://codereview.chromium.org/411033003

5 years agoRemove unnecessary aligned memory check when __SSE__ is used
Bo Xu [Wed, 23 Jul 2014 20:05:23 +0000]
Remove unnecessary aligned memory check when __SSE__ is used

Since the land of https://pdfium.googlesource.com/pdfium/+/3522876d5291922ddc62bf1b70d02743b0850673, memory is assured to be 16 byte aligned. So no need to do this check.

Plus, the removed code was causing bug in M36: https://code.google.com/p/pdfium/issues/detail?id=27.

BUG=None
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/418563002

5 years agoOnly use "final" on MSVS2012+, to keep pdfium building with 2010.
Nico Weber [Wed, 23 Jul 2014 17:54:59 +0000]
Only use "final" on MSVS2012+, to keep pdfium building with 2010.

BUG=pdfium:26
TBR=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/418463002

5 years agoFix potential memory violation in CJS_PublicMethods::StrRTrim()
Tom Sepez [Wed, 23 Jul 2014 17:50:06 +0000]
Fix potential memory violation in CJS_PublicMethods::StrRTrim()

BUG=395266
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/411713003

5 years agoFix lookahead beyond bounds in CJS_PublicMethods::MakeFormatDate().
Tom Sepez [Wed, 23 Jul 2014 17:28:37 +0000]
Fix lookahead beyond bounds in CJS_PublicMethods::MakeFormatDate().

BUG=396255
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/407243003

5 years agoFix FPDF_RenderPage 2x zoom in when bBackgroundAlphaNeeded is true
Bo Xu [Wed, 23 Jul 2014 17:09:08 +0000]
Fix FPDF_RenderPage 2x zoom in when bBackgroundAlphaNeeded is true

BUG=179413
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/410073002

5 years agoAdded options to save pages into BMP and EMF on Windows.
Vitaly Buka [Wed, 23 Jul 2014 01:15:42 +0000]
Added options to save pages into BMP and EMF on Windows.

BUG=179413
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/408403002

5 years agoAdjust null object check
Bo Xu [Mon, 21 Jul 2014 17:02:07 +0000]
Adjust null object check

BUG=None
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/396173003

5 years agoFix remaining -Wdelete-non-virtual-dtor violations on Windows.
Nico Weber [Mon, 21 Jul 2014 16:50:56 +0000]
Fix remaining -Wdelete-non-virtual-dtor violations on Windows.

Follow-up to https://codereview.chromium.org/370853002/

BUG=none
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/406683005

5 years agoBuild with exceptions enabled on Windows too.
Nico Weber [Fri, 18 Jul 2014 22:50:30 +0000]
Build with exceptions enabled on Windows too.

This should be set consistently on all platforms. Ideally, we wouldn't
need exceptions, but for now they're used.

BUG=none (noticed while looking at chromium:82385)
R=jam@chromium.org

Review URL: https://codereview.chromium.org/404803005

5 years agoFix the potential integer overflow from "offset + size".
Chris Palmer [Fri, 18 Jul 2014 22:18:43 +0000]
Fix the potential integer overflow from "offset + size".

BUG=382667
R=jschuh@chromium.org, jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/390983007

5 years agoFix bounds checking in CJS_PublicMethods::MakeRegularDate().
Tom Sepez [Fri, 18 Jul 2014 21:42:12 +0000]
Fix bounds checking in CJS_PublicMethods::MakeRegularDate().

The function is looking ahead N characters at both its "format" and "value"
strings without validating that accesses are in bounds.  Add those validations.

There are also duplicate checks in the else-branches which re-test the inverse
of the if-branch.  These are removed for simplicity.

I also tidied some stray whitespace in the function while I was at it.

BUG=393831
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/395303004

5 years agoFix pdfium building issue on VS2010
Jun Fang [Fri, 18 Jul 2014 16:36:53 +0000]
Fix pdfium building issue on VS2010

BUG=pdfium_23
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/399233002

5 years agopdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac.
Nico Weber [Fri, 18 Jul 2014 16:14:35 +0000]
pdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac.

Calling `delete` on an object of a type that has virtual functions but
not a virtual destructor is questionable: Since the object has virtual functions,
it likely has subclasses, so if it's deleted through the base pointer and the
destructor isn't virtual, the subclass destructor won't be called.

In most cases, the classes getting deleted can just be marked final to tell
the compiler that it can't possibly have subclasses (this also enables the
compiler to generate better code).

Two classes didn't have any sub- or superclasses but virtual functions -
this doesn't make sense, so make all methods of these classes non-virtual.
(Also delete an unused function on one of the two classes.)

In one case, a class actually did have a subclass that needs to be deleted
virtually, so mark one destructor as virtual.

BUG=none
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/370853002

5 years agoFix garbled text when loading linearized pdf document
Bo Xu [Thu, 17 Jul 2014 18:13:13 +0000]
Fix garbled text when loading linearized pdf document

BUG=260112, 249006, 275281, 354966, 365302, 236952
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/400083002

5 years agoFix building pdfium for x64 with ninja under windows.
Nico Weber [Thu, 17 Jul 2014 16:02:20 +0000]
Fix building pdfium for x64 with ninja under windows.

This adds the necessary directives to the standalone gyp file.

R=jschuh@chromium.org, jam@chromium.org
BUG=22

Patch from Michael Doppler <m.doppler@gmail.com>.

Review URL: https://codereview.chromium.org/360273002

5 years agoHook up the default v8::Platform implementation to pdfium
Jochen Eisinger [Thu, 17 Jul 2014 06:46:45 +0000]
Hook up the default v8::Platform implementation to pdfium

It remains to call the PumpMessageLoop() method at a regular interval,
however, since nothing posts to the loop yet, that shouldn't be a
problem.

BUG=25
R=jam@chromium.org

Review URL: https://codereview.chromium.org/374123002

5 years agoDisable warning 4267 in pdfium until it is fixed.
Nico Weber [Thu, 17 Jul 2014 00:31:56 +0000]
Disable warning 4267 in pdfium until it is fixed.

BUG=376399
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/398163006

5 years agoRemove unused variable orig_size.
Bo Xu [Wed, 16 Jul 2014 23:31:29 +0000]
Remove unused variable orig_size.

Original patch by Andrey Khalyavin <halyavin@google.com>

BUG=N/A
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/384143002

5 years agoDo not disable warnings-as-errors for pdfium.
Nico Weber [Wed, 16 Jul 2014 20:44:28 +0000]
Do not disable warnings-as-errors for pdfium.

It currently doesn't have any build warnings, and this way the
chromium build is guaranteed to stay warning-free after pdfium rolls.

BUG=none
R=jam@chromium.org

Review URL: https://codereview.chromium.org/373643002

5 years agoAdd a newline at the end of fpdfeditpage.cpp.
Nico Weber [Wed, 16 Jul 2014 20:19:08 +0000]
Add a newline at the end of fpdfeditpage.cpp.

Fixes a warning.

BUG=
TBR=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/395293002

5 years agoRemove uninitialized const global g_GbFontNameMap.
Nico Weber [Wed, 16 Jul 2014 18:07:33 +0000]
Remove uninitialized const global g_GbFontNameMap.

C++11 makes uninitialized const PODs an error, because they contain
uninitialized memory (they're uninitialized that can never be initialized
(because they're const).

In this case, the memory was only used by _GetSubFontName() if the lang
parameter was 1, but _GetSubFontName() is only called from one place, with
a lang parameter of 0. So remove _GetSubFontName()'s lang parameter too.

(Using bsearch for searching an array that always has exactly 2 entries is
overkill too, but I'm trying to keep the diff small.)

No intended behavior change. Fixes this error on the clang/win bot:
..\..\third_party\pdfium\core\src\fxge\win32\fx_win32_device.cpp(207,20) :  error(clang): default initialization of an object of const type 'const _FontNameMap [1]'
const _FontNameMap g_GbFontNameMap[1];
                   ^

BUG=chromium:82385
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/369343003

5 years agoError handling for invalid component number in CPDF_ICCBasedCS::v_Load
Jun Fang [Wed, 16 Jul 2014 03:42:53 +0000]
Error handling for invalid component number in CPDF_ICCBasedCS::v_Load

BUG=386728
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/397803002

5 years agoFix uninitialized coords in _DrawCoonPatchMeshes
Jun Fang [Tue, 15 Jul 2014 03:57:18 +0000]
Fix uninitialized coords in _DrawCoonPatchMeshes

BUG=391470
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/384593002

5 years agoFix uninitialized nresults in GetRGB
Jun Fang [Tue, 15 Jul 2014 00:07:23 +0000]
Fix uninitialized nresults in GetRGB

BUG=387809
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/379283003

5 years agoFix uninitialized RGB in DrawShading
Jun Fang [Mon, 14 Jul 2014 23:31:37 +0000]
Fix uninitialized RGB in DrawShading

BUG=386730
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/379923012

5 years agoFix uninitialized Storage in _LUTeval16
foxit [Mon, 14 Jul 2014 21:46:37 +0000]
Fix uninitialized Storage in _LUTeval16

BUG=387826
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/387273002

5 years agoAdd support to extract viewer preference
Bo Xu [Mon, 14 Jul 2014 20:22:47 +0000]
Add support to extract viewer preference

This change adds the support to extract "NumCopies", "PrintPageRange", "Duplex" viewer preferences for printing.

BUG=169120
R=bo_xu@foxitsoftware.com, vitalybuka@chromium.org

Review URL: https://codereview.chromium.org/345123002

5 years agoFix an out-of-boundary issue for wide string
Bo Xu [Mon, 14 Jul 2014 19:13:53 +0000]
Fix an out-of-boundary issue for wide string

BUG=381521
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/383563002

5 years agoFix uninitialized Storage
foxit [Thu, 10 Jul 2014 20:36:32 +0000]
Fix uninitialized Storage

BUG=387843
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/380293002

5 years agoFix uninitialized okeybuf
foxit [Thu, 10 Jul 2014 19:10:06 +0000]
Fix uninitialized okeybuf

BUG=387011
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/382603003

5 years agoFix uninitialized triangle
foxit [Thu, 10 Jul 2014 19:06:13 +0000]
Fix uninitialized triangle

BUG=387835
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/381173002

5 years agoZero out temporary arrays before use in PDF encryption.
Bo Xu [Thu, 10 Jul 2014 18:49:52 +0000]
Zero out temporary arrays before use in PDF encryption.

BUG=387834
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/386663003

5 years agoFix a null object bug
Bo Xu [Wed, 9 Jul 2014 21:03:51 +0000]
Fix a null object bug

BUG=387975
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/379273002

5 years agoFixes for re-enabling more MSVC level 4 warnings: pdfium/ edition (try 2)
Lei Zhang [Wed, 9 Jul 2014 18:47:15 +0000]
Fixes for re-enabling more MSVC level 4 warnings: pdfium/ edition (try 2)

This contains fixes for the following sorts of issues:
* Nonstandard extension: unnamed struct/union

This also changes the signature of FPDF_FillRect() to enable the cleanest
possible changes in https://codereview.chromium.org/372273005 .

BUG=81439
TEST=none

Original patch by Peter Kasting <pkasting@chromium.org>
Original code review: https://codereview.chromium.org/376003003/

R=pkasting@chromium.org

Review URL: https://codereview.chromium.org/377353002

5 years agoFix a null object check
Bo Xu [Wed, 9 Jul 2014 17:56:52 +0000]
Fix a null object check

BUG=390615
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/378293005

5 years agoFix BUILD.gn for commit 3522876d.
Lei Zhang [Wed, 9 Jul 2014 00:05:23 +0000]
Fix BUILD.gn for commit 3522876d.

TBR=palmer@chromium.org

Review URL: https://codereview.chromium.org/378073002

5 years agoRevert commit 95c018e2d15ecc3a5bd2a9aab18638316a6d3d46
Lei Zhang [Tue, 8 Jul 2014 23:56:13 +0000]
Revert commit 95c018e2d15ecc3a5bd2a9aab18638316a6d3d46

Fixes for re-enabling more MSVC level 4 warnings: pdfium/ edition

BUG=81439
TBR=pkasting@chromium.org

Review URL: https://codereview.chromium.org/376043003

5 years agoFixes for re-enabling more MSVC level 4 warnings: pdfium/ edition
Lei Zhang [Tue, 8 Jul 2014 23:42:00 +0000]
Fixes for re-enabling more MSVC level 4 warnings: pdfium/ edition

This contains fixes for the following sorts of issues:
* Nonstandard extension: unnamed struct/union

This also changes the signature of FPDF_FillRect() to enable the cleanest
possible changes in https://codereview.chromium.org/372273005 .

BUG=81439
TEST=none

Original patch by Peter Kasting <pkasting@chromium.org>
Original code review: https://codereview.chromium.org/376003003/

R=pkasting@chromium.org

Review URL: https://codereview.chromium.org/372383004

5 years agoRemove custom memory manager
Bo Xu [Tue, 8 Jul 2014 22:30:46 +0000]
Remove custom memory manager

BUG=
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/372473003

5 years agoFix for UMR in CXML_Parser::GetCharRef.
Chris Palmer [Tue, 8 Jul 2014 21:02:05 +0000]
Fix for UMR in CXML_Parser::GetCharRef.

BUG=387822
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/367383002

5 years agoFix integer overflow in fx_basic_[bw]string.cpp.
Chris Palmer [Tue, 8 Jul 2014 20:27:00 +0000]
Fix integer overflow in fx_basic_[bw]string.cpp.

BUG=382601
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/336003004

5 years agoFix a crasher issue due to invalid 'bits per component' in PDF
foxit [Mon, 7 Jul 2014 21:36:22 +0000]
Fix a crasher issue due to invalid 'bits per component' in PDF

BUG=382820
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/349853003

5 years agofix a crash issue in _CMapLookupCallback
foxit [Mon, 7 Jul 2014 21:06:56 +0000]
fix a crash issue in _CMapLookupCallback

BUG=382242
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/341333004

5 years agoFix uninitialized nresults and RGB
foxit [Mon, 7 Jul 2014 21:03:18 +0000]
Fix uninitialized nresults and RGB

BUG=387785
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/362403002

5 years agoFix uninitialized offset
foxit [Mon, 7 Jul 2014 21:00:41 +0000]
Fix uninitialized offset

BUG=387783
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/368783004

5 years agoFix uninitialized RGB in GetRGB
foxit [Mon, 7 Jul 2014 20:58:24 +0000]
Fix uninitialized RGB in GetRGB

BUG=386729
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/366803003

5 years agoFix uninitialized RGB in translating scanline
foxit [Mon, 7 Jul 2014 20:55:44 +0000]
Fix uninitialized RGB in translating scanline

BUG=387841
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/354363003

5 years agoInteger overflow in fx_basic.h and fx_memory.h
foxit [Mon, 7 Jul 2014 20:53:16 +0000]
Integer overflow in fx_basic.h and fx_memory.h

BUG=382656
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/334573007

5 years agoFix uninitialized RGB in LoadPalette
foxit [Mon, 7 Jul 2014 20:50:21 +0000]
Fix uninitialized RGB in LoadPalette

BUG=387506
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/361103002

5 years agoFix uninitialized font_offset
foxit [Mon, 7 Jul 2014 20:42:30 +0000]
Fix uninitialized font_offset

BUG=387840
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/354413002

5 years agoFix syntax error in BUILD.gn
John Abd-El-Malek [Mon, 30 Jun 2014 19:54:56 +0000]
Fix syntax error in BUILD.gn

5 years agoFix checklicenses in chromium
John Abd-El-Malek [Mon, 30 Jun 2014 19:30:03 +0000]
Fix checklicenses in chromium

5 years agoRemove "this==NULL" and adjust corresponding callers
Bo Xu [Mon, 30 Jun 2014 16:49:21 +0000]
Remove "this==NULL" and adjust corresponding callers

BUG=
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/361553002

5 years agoFix standalone build.
John Abd-El-Malek [Mon, 30 Jun 2014 16:26:25 +0000]
Fix standalone build.

BUG=20
R=jschuh@chromium.org

Review URL: https://codereview.chromium.org/349033008

5 years agoImport Chromium base/numerics to resolve integer overflow.
Chris Palmer [Thu, 26 Jun 2014 23:01:46 +0000]
Import Chromium base/numerics to resolve integer overflow.

We'll use this for integer overflows going forward.

BUG=382606
R=jam@chromium.org

Review URL: https://codereview.chromium.org/349363005

5 years agoExplicitly use binary mode when opening files in the pdfium_test sample.
John Abd-El-Malek [Thu, 26 Jun 2014 17:18:11 +0000]
Explicitly use binary mode when opening files in the pdfium_test sample.

This patch adds the 'b' (binary mode) flag to the fopen calls.

Before the fix the PPM images written with --write_images were corrupted
under Windows because on this platform in text mode all occurrences of
the byte 0xa (line feed) are replaced with the bytes 0x0d (carriage
return) and 0x0a (line feed).

On UNIX platforms the 'b' flag is supported but ignored, because no
translation of the line feed character takes place.

BUG=18
R=jam@chromium.org

Original patch by Michael Doppler <m.doppler@gmail.com>

Review URL: https://codereview.chromium.org/343303004

5 years agoFix and integer overflow issue in SDK's QuickSort
Bo Xu [Tue, 24 Jun 2014 18:37:49 +0000]
Fix and integer overflow issue in SDK's QuickSort

BUG=382639
R=mdempsky@chromium.org

Review URL: https://codereview.chromium.org/354673002

5 years agoRevert "Import Chromium base/numerics to resolve integer overflow."
John Abd-El-Malek [Mon, 23 Jun 2014 22:24:28 +0000]
Revert "Import Chromium base/numerics to resolve integer overflow."

This reverts commit d9713f05fdcecab8428d39034c6b84cd0bbd2920.

This is breaking compile.

5 years agoBUG=382241
foxit [Sat, 21 Jun 2014 00:07:21 +0000]
BUG=382241
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/331123002

5 years agoFix a crash in CFXMEM_FixedMgr::AllocLarge
foxit [Sat, 21 Jun 2014 00:03:04 +0000]
Fix a crash in CFXMEM_FixedMgr::AllocLarge

BUG=382243
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/333213002

5 years agoStack-buffer-overflow in IccLib_Translate
foxit [Fri, 20 Jun 2014 23:48:43 +0000]
Stack-buffer-overflow in IccLib_Translate

BUG=382240
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/332143002

5 years agoImport Chromium base/numerics to resolve integer overflow.
Chris Palmer [Fri, 20 Jun 2014 23:30:49 +0000]
Import Chromium base/numerics to resolve integer overflow.

We'll use this for integer overflows going forward.

BUG=382606
R=bo_xu@foxitsoftware.com, jschuh@chromium.org

Review URL: https://codereview.chromium.org/341533007

5 years agoFix JS_WIDESTRING to work with clang-cl
John Abd-El-Malek [Thu, 19 Jun 2014 15:07:13 +0000]
Fix JS_WIDESTRING to work with clang-cl

MSVC lexes L#macro_arg as a single wide string literal token, but
Clang and other C/C++ compliant lexers do not.  There was already
a workaround to use implicit string concatenation for GCC, but there's
a simpler solution of token pasting the L onto the stringized macro
argument with 'L###macro_arg'.  This works with Clang, GCC, and MSVC.

R=jun_fang@foxitsoftware.com, jam@chromium.org
BUG=82385

Original patch by Reid Kleckner <rnk@chromium.org>

Review URL: https://codereview.chromium.org/345643002

5 years agoresolve symbol collsion with zlib 1.2.8
Bo Xu [Thu, 12 Jun 2014 20:42:40 +0000]
resolve symbol collsion with zlib 1.2.8

R=jam@chromium.org

Review URL: https://codereview.chromium.org/330023004

5 years agoAdd FPDFPage_SetRotation function
Bo Xu [Thu, 12 Jun 2014 20:41:50 +0000]
Add FPDFPage_SetRotation function

R=jam@chromium.org

Review URL: https://codereview.chromium.org/336563004

5 years agoEnable security removal in FPDF_Doc_Save
Bo Xu [Thu, 12 Jun 2014 20:40:04 +0000]
Enable security removal in FPDF_Doc_Save

R=jam@chromium.org

Review URL: https://codereview.chromium.org/333753002

5 years agoBring back the Skia files from the old repo.
John Abd-El-Malek [Wed, 11 Jun 2014 20:34:16 +0000]
Bring back the Skia files from the old repo.

BUG=11

5 years agoBUG=379656
foxit [Tue, 10 Jun 2014 21:40:42 +0000]
BUG=379656
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/320223003

5 years agofree, rather than delete, malloc'd object.
John Abd-El-Malek [Mon, 9 Jun 2014 23:10:57 +0000]
free, rather than delete, malloc'd object.

BUG=381031

Original patch by Chris Palmer <palmer@chromium.org>

Review URL: https://codereview.chromium.org/322453002

5 years agoDisable pointer-to-int conversion warning.
John Abd-El-Malek [Mon, 9 Jun 2014 23:07:18 +0000]
Disable pointer-to-int conversion warning.

In this case the warning is benign.

Original patch by Brett Wilson <brettw@chromium.org>

R=jam@chromium.org

Review URL: https://codereview.chromium.org/319033002

5 years agoFix a crash when parsing truetype fonts without any tables.
Lei Zhang [Mon, 9 Jun 2014 19:16:58 +0000]
Fix a crash when parsing truetype fonts without any tables.

BUG=chromium:381011
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/317203003

5 years agoUse none SSE functions when data is not 16 byte aligned
foxit [Sun, 8 Jun 2014 23:35:48 +0000]
Use none SSE functions when data is not 16 byte aligned

BUG=
R=jabdelmalek@google.com

Review URL: https://codereview.chromium.org/318593002

5 years agoAdd GN build file for pdfium, rename GYP target.
John Abd-El-Malek [Thu, 5 Jun 2014 19:45:33 +0000]
Add GN build file for pdfium, rename GYP target.

The GYP target is now called "pdfium" rather than "fpdfsdk".

Original pach by Brett Wilson <brettw@chromium.org>

5 years agofix two uninitialized reads
John Abd-El-Malek [Thu, 5 Jun 2014 18:12:52 +0000]
fix two uninitialized reads
https://code.google.com/p/pdfium/issues/detail?id=9
https://code.google.com/p/pdfium/issues/detail?id=10

BUG=
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/312273002

5 years agoUse unsigned type for iteration to avoid int overflow.
John Abd-El-Malek [Wed, 4 Jun 2014 21:42:19 +0000]
Use unsigned type for iteration to avoid int overflow.

If src_len in PDF_DecodeText is larger than 2^31,
2 * max_chars will overflow and the function will produce
an incorrect result.

BUG=none
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/306923006

5 years agoWrong variable assignment in Pdfium.
John Abd-El-Malek [Wed, 4 Jun 2014 17:52:59 +0000]
Wrong variable assignment in Pdfium.

CID=115579

Original patch by Finnur Thorarinsson <finnur@chromium.org>

5 years agoIn linux and mac, use Arial to replace Tahoma for displaying east europe characters
Bo Xu [Thu, 29 May 2014 18:32:56 +0000]
In linux and mac, use Arial to replace Tahoma for displaying east europe characters

BUG=

Review URL: https://codereview.chromium.org/301263002

5 years agoFix xcode build.
John Abd-El-Malek [Thu, 29 May 2014 15:01:22 +0000]
Fix xcode build.

R=thakis@chromium.org

Review URL: https://codereview.chromium.org/300993002

5 years agoFollowup comments from https://codereview.chromium.org/298893007/
John Abd-El-Malek [Wed, 28 May 2014 20:35:54 +0000]
Followup comments from https://codereview.chromium.org/298893007/

R=thakis@chromium.org

Review URL: https://codereview.chromium.org/302653009

5 years agoFix a security issue in FPDF_GetMetaText
Bo Xu [Wed, 28 May 2014 17:21:47 +0000]
Fix a security issue in FPDF_GetMetaText

BUG=security

Review URL: https://codereview.chromium.org/307653002