Age | Commit message (Collapse) | Author |
|
Fixed issue with unit tests that was causing raw data to be backwards
and reverted related LSB -> MSB change that was introduced due to
this.
If global palette not set then the background colour index should be
0.
Check that background colour index is valid when global palette
exists.
Check if transparency index is valid for the palette of the frame it
is being applied to.
BUG=chromium:770337
Change-Id: I5d9b648f45bbb4c93218664a7035e4d01dbeb627
Reviewed-on: https://pdfium-review.googlesource.com/15453
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Break up reading the signature and local screen descriptors into
seperate functions. Fix a bug in how matching in the signature
validation works. Move LSD value assignment to after sufficient data
has been confirmed. Convert LSB to MSB methods where they were just
wrong. Add unit tests for ReadData, SetInputBuffer, ReadSignature,
ReadLocalScreenDescriptor, and ReadHeader.
BUG=pdfium:913,chromium:770470
Change-Id: I1683b8aefc11300625b9be8087c6988549308a8f
Reviewed-on: https://pdfium-review.googlesource.com/15250
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The existing implementation of a LSB first word method was incorrect,
in addition it was implemented to the BMP code, but also used in the
GIF code. Thus is should be moved to a common location.
Also added in an implementation for FXWORD_GET_MSBFIRST, since the
GIF code will need this.
BUG=pdfium:914
Change-Id: I0e84813356fbd456b293a190da3c2cde01a6580b
Reviewed-on: https://pdfium-review.googlesource.com/15210
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Remove unused defines; Move to .cpp files where possible; Fixup values.
Change-Id: I88cd5deb04b14ab8e9f8097a695c3d0b52d64b4c
Reviewed-on: https://pdfium-review.googlesource.com/15130
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Remove unused defines.
Change-Id: Ibf10d8470f19cbf4528fe1342398a39ef15c1d12
Reviewed-on: https://pdfium-review.googlesource.com/15110
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Speciifically replacing what was called the "stack_", an array, with a
vector called "decompressed_". The fact that this data structure
wasn't actually a stack caused a lot of grief when refactoring.
BUG=pdfium:903
Change-Id: I056f8fc9183bcde67a03dc9de0dae9ddf9fb0f37
Reviewed-on: https://pdfium-review.googlesource.com/15092
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL simplifies the OS == WIN{32|64} checks to be PLATFORM == WINDOWS
checks.
Change-Id: I1493d316dd457b0228e4ef39db4cf1d2b8abf97d
Reviewed-on: https://pdfium-review.googlesource.com/14870
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
These are error strings are set but never used for anything.
BUG=pdfium:907
Change-Id: I08d9547009116f7386d15b4a965b9a99c7bf1997
Reviewed-on: https://pdfium-review.googlesource.com/15010
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Moved everything from core/fxcodec/lgif to core/fxcodec/gif
Converted CGifContext -> CFX_GifContext
Removed _ptr suffixes from CXF_GifContext
Movef fx_gif.* -> cfx_gif.*
Renamed structs in cfx_gif.h
Renamed members of CFX_GifImage
Renamed members of CFX_GifContext
Renamed CFX_LZWDecoder -> CFX_LZWDecompressor
BUG=pdfium:903
Change-Id: I537e905e935da26832e6bbdc03e0373ed5500bcb
Reviewed-on: https://pdfium-review.googlesource.com/14990
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This string is set, but never used.
BUG=pdfium:907
Change-Id: I57555d0dd3670b245554ff2d7163d1d04bcdb7e8
Reviewed-on: https://pdfium-review.googlesource.com/14930
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
With the conversion of internal string sizes to size_t, these wrappers
are no longer needed. Replacing them with strlen and wcslen
respectively.
BUG=pdfium:828
Change-Id: Ia087ca2ddaf688a57ec9bd9ddfb8533cbe41510d
Reviewed-on: https://pdfium-review.googlesource.com/14890
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:828
Change-Id: I5c40237433ebabaeabdb43aec9cdf783e41dfe16
Reviewed-on: https://pdfium-review.googlesource.com/13230
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
A lot of the structs in the GIF code use acronyms that are non-obvious
unless you are familar with the GIF spec, and even then lead to lots
of looking back. Making the naming more explicit. Also converted
GifImage to be a struct, since it didn't have any methods defined for
it.
BUG=pdfium:903
Change-Id: I97ca2adfdc4ada8bcaef5f8f317c1dea7365d70d
Reviewed-on: https://pdfium-review.googlesource.com/14836
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This was causing us to use the local palette values when they didn't
exist, instead of the global palette values.
BUG=chromium:769292
Change-Id: I02d19cbcf0cf9e362e123fc7648d8f47991b8155
Reviewed-on: https://pdfium-review.googlesource.com/14910
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes unreachable code and also removes the flag
Icc_Format_DEFAULT which becomes unused.
Bug: chromium:346399
Change-Id: I1cdd0f70ffec2abcd20ddf5b181273971b92ecaa
Reviewed-on: https://pdfium-review.googlesource.com/14850
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
|
|
This CL renames the FX_OS defines to have _OS_ in their names and drops
the _DESKTOP suffix. The FXM defines have been changed to just FX.
Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74
Reviewed-on: https://pdfium-review.googlesource.com/14833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The _FX_IOS_ define is never defined, so it isn't useful to check
_FX_OS_ against. Remove.
Change-Id: I90b50a1a0dc165073ed223cbfe861b9a227818dd
Reviewed-on: https://pdfium-review.googlesource.com/14831
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Previous implementation assumed that if the local colour palette was
not specified and the global palette had its size specified, then use
the global. If the global palette is disable, it will not have data,
but it may have a size. Technically the size is giberish in this case,
but the value is allowed to be non-zero, so isn't a sufficient check.
BUG=chromium:768089
Change-Id: Iaec15fcd65f3983056df7d56d29118a516334cd9
Reviewed-on: https://pdfium-review.googlesource.com/14819
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
CGifLZWDecoder has been moved out into its own file, name changed to
CFX_LZWDecoder, member variable names updated, creation pattern
changed, and unit tests added.
Wrt the creation pattern, there is no longer a constructor and 2
initialization methods that need to be called. Instead all of the
initialization is done as part of the constructor. A wrapper has been
added for generating a std::unique_ptr<CFX_LZWDecoder>, so that params
can be validated.
BUG=pdfium:900,pdfium:901,pdfium:903,pdfium:904
Change-Id: Idcbe773f7fb18b08e64d5a89bfd87d4801332c53
Reviewed-on: https://pdfium-review.googlesource.com/14814
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
There are a number of functions in fx_gix.h/.cpp that take in a
pointer to a CGifContext as their first parameter. Moving these to be
methods in that class.
BUG=pdfium:902
Change-Id: I8c583ab9e42dda4241aa8a6f865408a94fa6d273
Reviewed-on: https://pdfium-review.googlesource.com/14670
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The core fix in this CL is a change to how LWZ decompression works, so
that when the min code table size and the color palette size are
different, color codes after the end of the defined color palette are
considered errors.
This CL also introduces a bunch of tweaks to the call return path,
since there were multiple locations where the GIF decode failing
status was being dropped on the floor, so the end widget would have a
bitmap with the default colour in it, instead of nothing.
BUG=chromium:616671
Change-Id: Id6f40d552dc24650c91e9903f710ff2fa63bc774
Reviewed-on: https://pdfium-review.googlesource.com/14630
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0
Reviewed-on: https://pdfium-review.googlesource.com/14620
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e
Reviewed-on: https://pdfium-review.googlesource.com/14616
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves CFX_MaybeOwned into the fxcrt namespace and removes the
CFX_ prefix.
The test names for maybe owned were updated to be in the MaybeOned test
suite instead of the fxcrt suite.
Bug: pdfium:898
Change-Id: I0c07057d66c8610e7b19133094b4507fff725e76
Reviewed-on: https://pdfium-review.googlesource.com/14470
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Then set up the right dependencies for them.
BUG=chromium:765914
Change-Id: I036cd888c741927d5efe0d020c6676f169e7cbb1
Reviewed-on: https://pdfium-review.googlesource.com/14410
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I020b862619f3f93f71dbb027b9e799d78744f686
Reviewed-on: https://pdfium-review.googlesource.com/14391
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Icacf877e2b66ca7d49637dcf9eaec0f99bcdd8bb
Reviewed-on: https://pdfium-review.googlesource.com/14390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I703321108712e8c4a11a8343ecf8b1a8804c1d1a
Reviewed-on: https://pdfium-review.googlesource.com/14352
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Now considering anything not representable by a 32-bit signed int
as OOB rather than decoding some arbitrary overflowed value.
Bug: chromium:761666
Change-Id: I00f5a3abadca51f9bedc5e5d78f7f184040c2f33
Reviewed-on: https://pdfium-review.googlesource.com/14010
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Due to some of the size parameters for allocating space in Decode()
depending on the values produced by opj_decode(), this change was
causing misallocation of space, which in turn was causing illegal
reads/writes.
The issue with excessive memory usage that the original CL was trying
to change is less significant than the above mentioned problems, so
reverting this fix and looking for another solution to the
problem. This will re-open bugs https://crbug.com/754423 and
https://crbug.com/761005.
BUG=chromium:764177,chromium:754423,chromium:761005
Change-Id: I1cafac8a8117ec1e3bc32b31196bdec719d46477
Reviewed-on: https://pdfium-review.googlesource.com/13950
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:761005
Change-Id: I538e49f1eeb32891b33677d8587d2bed110b1fc1
Reviewed-on: https://pdfium-review.googlesource.com/13692
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This patch was authored by Ke Liu of Tencent's Xuanwu Lab.
BUG=762374
Change-Id: Icb3ee98fb4c399b871ccf11e9920af7caf51be11
Reviewed-on: https://pdfium-review.googlesource.com/13610
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
|
|
BUG=chromium:762106
Change-Id: I714d69320cc4fb81d535f811c18d4ef91fec44d3
Reviewed-on: https://pdfium-review.googlesource.com/13212
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
In the existing implementation of the JPX decoder, Init extracts the
header from the image and then immediately decompresses it. This is
problematic if it is a very large image that we won't be able to
allocate a bitmap for. The code has been changed to instead delay
decompression until the Decode method, since things like dest Bitmap
generation can be performed using just the header information.
There is also a bit of renaming/casting cleanup, because I was having
a hard time parsing what was a local vs member variable.
BUG=chromium:761005
Change-Id: I55a55c0be2f88a5352a6ca056c2a816137d7c749
Reviewed-on: https://pdfium-review.googlesource.com/13550
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ic54e0491d9b33a06b5f85963f8127bfa4263f4d6
Reviewed-on: https://pdfium-review.googlesource.com/12450
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL moves IFX_Pause out to its own class from fx_basic and updates
includes as needed.
Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b
Reviewed-on: https://pdfium-review.googlesource.com/12491
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL moves CFX_FixedBufGrow to its own files and updates includes as
needed.
Change-Id: Ia0cb70569b30acdb3ba9f23d8937ab8f9c17d6e6
Reviewed-on: https://pdfium-review.googlesource.com/12490
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL splits the CFX_BinaryBuf out of fx_basic into its own files. The
various includes have been updated.
Change-Id: I0fa616eeb4df6dd229c02dc3a0597b3dced59425
Reviewed-on: https://pdfium-review.googlesource.com/12412
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Bug: chromium:755532
Change-Id: Ib04426fab52d0ca1d2544a21fd2ce4faaa57123f
Reviewed-on: https://pdfium-review.googlesource.com/12430
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Refactor identical code used in decode_Template0_unopt() into their own
methods.
Change-Id: I37348a280ecc66d91fdcd3c9aabe49d2a8065417
Reviewed-on: https://pdfium-review.googlesource.com/11950
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:749610.
Change-Id: I4de7855aec552e6c143e7a8be6b90e44945a0fcb
Reviewed-on: https://pdfium-review.googlesource.com/11930
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I5f240cb0779648dc5427fecb5561086e7c0fb16a
Reviewed-on: https://pdfium-review.googlesource.com/10650
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Single no-op callback.
pdfium::clamp() where appropriate.
Use post-increment where appropriate.
Add helper functions for image type.
Change-Id: I1584a1c90b46bd87f6ee983b78b6a2119212d0fb
Reviewed-on: https://pdfium-review.googlesource.com/10270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Mechanical change to bring into conformance with style guide.
Change-Id: I80d06708ed5c40af7e797ea5dc6279a0b4f3cf6a
Reviewed-on: https://pdfium-review.googlesource.com/10250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Apply patch suggestions from reporter. Move all FX_Alloc'd memory
into unique_ptrs so that no bare FX_Alloc/Free_Free calls remain.
Fix a realloc / opj_realloc mismatch. Remove unused functions
color_apply_icc_profile() and color_apply_conversion(). Tidy along
the way, add some missing statics, and fix a confusing (but not quite
member shadowing) local name.
Bug: 752829
Change-Id: Ibf2d108a857e3de39e752c2c553a31e002a07caf
Reviewed-on: https://pdfium-review.googlesource.com/10230
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL creates CJBig2_HTRDProc::decode_image to reduce duplicated code
in the class.
Change-Id: Ie348179c96ff534f95cba401c4b9bd46e1c4e6ac
Reviewed-on: https://pdfium-review.googlesource.com/8410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL removes the JBig2_GsidProc since it is only used as a single
instance in each of the methods in CJBig2_HTRDProc, so it is completely
unnecessary.
Change-Id: I69d0a4a059b9eb6ebcbbb79b92ea1cd6c22cb1cb
Reviewed-on: https://pdfium-review.googlesource.com/7930
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes duplicate huffman_assign_code()s and changes some
return values and members to std::vector.
Change-Id: I47a1e0e2e88ff54ec799c97e92ec9ff5ca87c6c7
Reviewed-on: https://pdfium-review.googlesource.com/7910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|