Resolve compilation error with G++ 4.9.

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
Update openjpeg to r2920

BUG=414036, 425151
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/688633003
For v8 Global Object, do not copy in CJS_Value constructor.

BUG=425129
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/688303003
Undo an old change in freetype to account for size of USHORT

BUG=418582
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/680833006
Fix PDFium build with Windows GN.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/695183005
Adding constructor to _FX_SYSTEMTIME to resolve uninitialized read bugs found by /analyze on some error paths

Warning from /analyze was:
src\third_party\pdfium\fpdfsdk\include\fsdk_mgr.h(96) : warning C6001: Using uninitialized memory 'fxtime'.

Other error paths can also lead to reading from an uninitialized _FX_SYSTEMTIME object.

Code-gen for the constructor is small enough (four writes of zeroed EAX with VC++, less with gcc) to make putting the constructor in a .cc file unnecessary.

Approval of in-class member initialization would make this fix simpler but that has not quite been approved yet.

BUG=https://code.google.com/p/pdfium/issues/detail?id=70
BUG=427616
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/692533005
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
Fix a bug when performing StretchDIBits on bit mask

BUG=401988
R=vitalybuka@chromium.org

Review URL: https://codereview.chromium.org/618073003
Make DEPS use relative paths to fix recipe

Context: DEPS was originally added to pdfium to allow its recipe to
automatically check out its dependencies. The recipe used absolute
paths, and so the checkout directory's name ('pdfium') had to be
prefixed to the directory checkout of every dependency, as gclient in
the recipe worked one level above the pdfium checkout itself.

After change fe4537269fc7133320a5131638757f2ffa6bd854, the recipe no
longer worked. To fix this, I'm making DEPS use relative paths.

BUG=375773
R=jam@chromium.org

Review URL: https://codereview.chromium.org/724113003
Build pdfium_test executable under GN.

This is the first side of a two-sided patch;
the dependency on //third_party/pdfium/samples will be included from //pdf/BUILD.gn in the chrome repo.

BUG=https://code.google.com/p/pdfium/issues/detail?id=77
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/720193004
Fix build warning on android under stricter compilation rules.

Error is "converting to non-pointer type 'FX_DWORD'".
TBR=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/726033002
Change from 'this' to L'this' and remove the cast that was hiding this mismatch.

Found by VC++'s /analyze. Warning was:

fpdfsdk\src\javascript\js_runtime.cpp(352) : warning C6276:
Cast between semantically different string types:  char * to wchar_t *.
Use of invalid string can lead to undefined behavior.

This mismatch has been there as far back as the history goes (to May of this year).

It looks like a real bug to me. However I don't know the implications of this bug and why it would not have been noticed at run-time.

The code has been this way as far back as the git history goes, but that is only to May 2014.

Original patch from Bruce Dawson(brucedawson@chromium.org)

BUG=427616
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/705503004
Remove FX_LPCWSTR cast to wchar_t* literals

BUG=https://code.google.com/p/pdfium/issues/detail?id=78
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/726143002
Correct typo in form fill environment functions

Complementary patch in chromium is in https://codereview.chromium.org/711553003

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/700373006
Rename functions in test code also -- fixing build-break from 2c021e0

Change 2c021e0 fixed spelling errors in a couple of functions, but didn't
update the test code leading to two compilation errors. Fixed in this
change.

Original patch from Bruce Dawson(brucedawson@chromium.org)

R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/727243002
Add Bruce to AUTHORS

R=jam@chromium.org

Review URL: https://codereview.chromium.org/727403003
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
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/727083002
Removing unnecessary casts from wchar_t* to wchar_t*, by various names.

Remove casts that merely cast from wchar_t* to wchar_t*. Sometimes the
types or casts are FX_LPCWSTR but the idea is the same. Excess casts
can (and have) hidden bugs so removing these may prevent future problems.

Original patch from Bruce Dawson(brucedawson@chromium.org)

R=bo_xu@foxitsoftware.com, tsepez@chromium.org

Review URL: https://codereview.chromium.org/730993002
Fixing format strings to remove 'z' size specifier.

As of the 2013 version VC++ still doesn't support the 'z' size specifier. This makes portable printing of size_t types frustrating. The simplest general solution is to use %u and cast to unsigned. If there was any possibility of the numbers getting larger than 32-bit then we would need better alternatives, but there is not.

This was found through code inspection, through /analyze, and through pdfium_test print this non-helpful message:

Loaded, parsed and rendered zu pages.
Skipped zu bad pages.

I can confirm that the fix works on Windows and it should work identically on mac. This is a follow-on to change 02e6ca4c4f.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/738433003
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
R=jun_fang@foxitsoftware.com

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