Age | Commit message (Collapse) | Author |
|
This pattern is widely used in chrome.
Change-Id: I64229b2ce298bf78773fe47c68d19be59411a76a
Reviewed-on: https://pdfium-review.googlesource.com/3293
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This Cl moves the CFX_DateTime, CFX_Decimal and IFX_Locale files into
core/fxcrt and builds only for XFA. The CFX_FormatString code is moved
info fgas/crt and renamed CFGAS_FormatString to match the fgas naming.
Change-Id: I8d9061195d2225da0389cbc9d018fcbd2e9a3c0c
Reviewed-on: https://pdfium-review.googlesource.com/3257
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Bug: chromium:655535
Change-Id: I114a9447a9af107e6056e6056e7514ba789e282b
Reviewed-on: https://pdfium-review.googlesource.com/3294
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Having move to partition alloc, string buffers are no longer
automatically pre-zero'd (nor should they because CFX strings
are implemented without this cycle-wasting assumption in mind).
BUG=705912
Change-Id: Ia0de263076c2a792ab546bd10c37a06b4251e7e2
Reviewed-on: https://pdfium-review.googlesource.com/3292
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Add a test for one of our types that fails unless this is the case.
Mark all our other move ctors as |noexcept|.
Change-Id: Ib106f219183d5abf94504af420a43c94b8f40e22
Reviewed-on: https://pdfium-review.googlesource.com/3251
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I10040b6504cf237f2e3e1f6075ae6a0612570461
Reviewed-on: https://pdfium-review.googlesource.com/3249
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Currently when the BitStream runs out of bits it pretends that it
still has content and will continue to return the last byte over and
over again. This Cl updates the jbig decoder to detect that the bit
stream is complete and returns a decode error.
Bug: chromium:665056
Change-Id: I61ca75713e677a2c280e80374b8dcfd48bee67d8
Reviewed-on: https://pdfium-review.googlesource.com/3244
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Add test for reading past end of buffer and successful read of bits.
Bug: chromium:672176
Change-Id: Ibe2d818185cdb2260011d3fc8cad94ebb16984b7
Reviewed-on: https://pdfium-review.googlesource.com/3233
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 31b08d4cdaa17d7a03f35e087096a77036af98ec.
Re-landing the patch after fixing skia build issue.
Change-Id: Ie7039890088b803a6ec5ce365d70f57277459b48
Reviewed-on: https://pdfium-review.googlesource.com/3245
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 0004f29bf6ee3c6060a272c79f14993e92e053c7.
Reason for revert: Breaks build with skia_paths enabled (which will break the chrome roll).
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:1858:38: error: no member named 'get' in 'CFX_RetainPtr<CFX_DIBitmap>'
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:1861:42: error: no member named 'get' in 'CFX_RetainPtr<CFX_DIBitmap>'
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2987:15: error: no viable overloaded '='
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2991:18: error: no viable overloaded '='
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2999:17: error: no viable overloaded '='
../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:3001:43: error: no member named 'GetObject' in 'CFX_RetainPtr<CFX_DIBitmap>'
Original change's description:
> Refcount all CFX_DIBSources (and subclasses) all the time.
>
> There are currently several ownership models for these objects,
> including ad-hoc logic for sharing and deletion, and the
> now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs.
>
> Replace them all with the internal refcount scheme.
>
> Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872
> Reviewed-on: https://pdfium-review.googlesource.com/3166
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: dsinclair <dsinclair@chromium.org>
>
TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I678b1fbc5e666cf7a19372ebaff3270fb115ba5e
Reviewed-on: https://pdfium-review.googlesource.com/3243
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
There are currently several ownership models for these objects,
including ad-hoc logic for sharing and deletion, and the
now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs.
Replace them all with the internal refcount scheme.
Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872
Reviewed-on: https://pdfium-review.googlesource.com/3166
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Simplify two more methods.
Change-Id: I1bb4c827a14f63c743336df152ff88a6b4e52934
Reviewed-on: https://pdfium-review.googlesource.com/3214
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This Cl converts some new calls into pdfium::MakeUnique calls.
Change-Id: Ifa4a67e305ffa75e2be560447ece21ccfa70bf3f
Reviewed-on: https://pdfium-review.googlesource.com/3232
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The methods to read n bits from the huffman stream are not correctly
checking that the bits are available. This means, we'll end up reading
0 bits due to the checks below and pretend like the read worked.
This Cl adds the check that we are not at the end of the bit buffer
before attempting the bit read.
Bug: chromium:672176
Change-Id: I206f2d54da31c344cf649ca024644d1cce762fe7
Reviewed-on: https://pdfium-review.googlesource.com/3231
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
- Flush is needed in ~CFX_FxgeDevice, otherwise it may be called after deleting
the bitmap, when calling the destructor of the skia device driver.
- SkDashPathEffect::Make copies the given intervals instead of owning them, so
free the input to that method.
- If StartDIBits creates a new CFX_ImageRenderer, then the corresponding
CancelDIBits needs to delete the handle.
Bug: chromium:705131
Change-Id: I22c7c51a4070e73538eb8af51a60afeaa67f8bb7
Reviewed-on: https://pdfium-review.googlesource.com/3230
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
If we get a requested length that is longer then the available buffer
size we bail as we won't be able to read the needed data anyway.
Bug: chromium:672177
Change-Id: Idb41671c07fe758ec0c1d4d6f84ead0a58fa8339
Reviewed-on: https://pdfium-review.googlesource.com/3221
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
BUG=chromium:703912
Change-Id: I5b4e582afc95b845e8e5e7a4e14581127c18de2d
Reviewed-on: https://pdfium-review.googlesource.com/3193
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This is the same version used by Chromium (as
also the latest release of zlib).
BUG=687631
Change-Id: Ia4bcdee3c36443ba01914d157ea795d7fb881a45
Reviewed-on: https://pdfium-review.googlesource.com/3096
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The crash on the new tab page is triggered by processing a transparency.
This creates a new Skia device in CPDF_RenderStatus::LoadSMask():
// cpdf_renderstatus.cpp # 2557
if (!bitmap_device.Create(width, height, format, nullptr))
which sets the Skia clip stack to empty.
It then calls
RenderObjectList()
RenderSingleObject()
ProcessClipPath()
which resets the clip stack;
// cpdf_renderstatus.cpp # 1882
m_LastClipPath = ClipPath;
m_pDevice->RestoreState(true);
At this point m_LastClipPath contains {m_Ref={m_pObject={m_pObj=empty } } }
The impelemntation in CFX_AggDeviceDriver::RestoreState() is
// fx_agg_driver.cpp # 1283
if (m_StateStack.empty())
return;
This hides unbalanced save/restores, but reworking PDFium to balance is nontrivial.
R=dsinclair@chromium.org
BUG=chromium:704442
Bug:
Change-Id: Ia70d4dd7bd118e40adc5c029acbaa0b66372d3aa
Reviewed-on: https://pdfium-review.googlesource.com/3191
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:681
Change-Id: I5073d80d9bd623b73e578d5ba2226c39c371bab0
Reviewed-on: https://pdfium-review.googlesource.com/3097
Commit-Queue: Chris Palmer <palmer@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Bug: chromium:704824
Change-Id: I3de1a0bcee3317cfaa7e56578b637e427098230a
Reviewed-on: https://pdfium-review.googlesource.com/3213
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I85ea9529f4188bf818ee96c37944e4546411f79c
Reviewed-on: https://pdfium-review.googlesource.com/3211
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Attach and Create methods may be called without _SKIA_SUPPORT_, so the bitmap
ownership code can't be if def'd to _SKIA_SUPPORT_.
Bug:chromium:704835
Change-Id: If6a7da508156ca3c45898bf101d84dd8295e479f
Reviewed-on: https://pdfium-review.googlesource.com/3210
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Ensure moved value becomes a nullptr after the move.
Update comment while we're at it.
Change-Id: I7a2999d5f5c5142cc7826cd7880b1e2317b5445f
Reviewed-on: https://pdfium-review.googlesource.com/3163
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Simplify CompositeRow_Argb2Argb method.
Change-Id: I8febf50375d5a0a56ba0eb77e921a506a6e327de
Reviewed-on: https://pdfium-review.googlesource.com/3161
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
SHOW_SKIA_PATH code had bit-rotted.
R=dsinclair@chromium.org
BUG=
Change-Id: I8961853aa0373fb0a04f829b8e78722197e8f5af
Reviewed-on: https://pdfium-review.googlesource.com/3122
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
CloneNonCycle() tries to detect cyclic object references without copying
them. There are two issues:
-- for elements in an array or a dictionary, they should be able to
refer to the same object, which are not cyclic;
-- for cyclic referenced elements in an array or a dictionary, do not
clone the element at all. Having nullptr or <key, nullptr> as an element,
like we did before, might cause crash when the element being accessed.
BUG=chromium:701860
Change-Id: Id0304accde76ed06fa5ce640994c7628359600fb
Reviewed-on: https://pdfium-review.googlesource.com/3156
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
If the command list is already empty when we attempt to restore the clip
we will access outside the command array.
BUG=chromium:704442
Change-Id: Ib7c44e14f0de175f1c10c1a538d16987aa49bf8a
Reviewed-on: https://pdfium-review.googlesource.com/3159
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 55d1d0191ea8316df32858d8cc62fb7c620e8613.
Reason for revert: Slowing down corpus tests by a lot on Mac/Win
Original change's description:
> Remove CFX_FixedBufGrow
>
> This Cl replaces the CFX_FixedBufGrow class with std::vector.
>
> Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe
> Reviewed-on: https://pdfium-review.googlesource.com/3138
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: dsinclair <dsinclair@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Iaee27570f140b2033b5d8fb8f3077fc839558d64
Reviewed-on: https://pdfium-review.googlesource.com/3158
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Change-Id: Ieaac36e06db3d1e2b857d999a7d3d9cd5c5a9506
Reviewed-on: https://pdfium-review.googlesource.com/3118
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I909deca1d0bfc6de5ac0fd2e6956f9b918caf17a
Reviewed-on: https://pdfium-review.googlesource.com/3157
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
More method simplification, new helper GetGrayWithBlend
Change-Id: Ice28591c590e2210f3b2864ac16b2d57abedeeb0
Reviewed-on: https://pdfium-review.googlesource.com/3145
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
If ParseIndirectObjectAt fails, the replaced object will be null. So we can't
ASSERT the output of ValidatePage. CL introducing the ASSERT:
https://codereview.chromium.org/2483633002/
BUG=chromium:702897
Change-Id: Ib6e8c0bccaf2c05893f0abef27d431e112064865
Reviewed-on: https://pdfium-review.googlesource.com/3146
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This Cl replaces the CFX_FixedBufGrow class with std::vector.
Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe
Reviewed-on: https://pdfium-review.googlesource.com/3138
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Add relational operators to replace CmpWord().
Leave CmpLine() for the moment as it saves some work.
Remove CmpSec() and just inline comparison of the one member.
Invert IsExist() as IsEmpty(). There is a big philosophical
discussion as to whether things that are empty exist. I say
they do, but they're just empty.
Rename Default() to Reset(). Default sounds like a noun.
Add AdvanceSection() method and call as appropriate.
Change-Id: I01d9479f63a4860e0fd228255540d6d94dc24a9f
Reviewed-on: https://pdfium-review.googlesource.com/3139
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This Cl moves the Matrix and Vector code which is only used by the
colorspace code into the colorspace cpp file.
Change-Id: Ie37bcee0978278a56d345e63704494b5b67e5b24
Reviewed-on: https://pdfium-review.googlesource.com/3137
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL replaces the FileSizeListArray code with a std::map.
Change-Id: Ic158ad95e7055693168d186ba428806a59b04c95
Reviewed-on: https://pdfium-review.googlesource.com/3136
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
- Merged two methods into CompositeRow_AToMask
- Simplified CompositeRow_Argb2Graya a lot
Change-Id: Icc96ac30121082ef4d6cb170d1e4f918b109b1be
Reviewed-on: https://pdfium-review.googlesource.com/3134
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
If the Kids array for the Pages dictionary does not exist, just treat this
dictionary as the unique page in the document.
BUG=chromium:702883
Change-Id: I9cb9645a53d60306ffe563f9b27cbbd37442f4ec
Reviewed-on: https://pdfium-review.googlesource.com/3135
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I4354a841d6e2d4f30ccb298d13dffa49b9f3a3b3
Reviewed-on: https://pdfium-review.googlesource.com/3131
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Fix some nits, add helper methods GetAlpha and GetGray to reduce code
duplication.
Change-Id: I5ea7e9ae306a4fc83f861f0e65879731e680f4f8
Reviewed-on: https://pdfium-review.googlesource.com/3109
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I4c00324990a62b624596110f442969a988631cb3
Reviewed-on: https://pdfium-review.googlesource.com/3105
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
We never push nullptrs into this array, so remove some checks for
nullness, but be really careful about bounds checking.
Change-Id: I79960a4cc9a729b3d5985f297aea8c4b03ceb601
Reviewed-on: https://pdfium-review.googlesource.com/3103
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:667
Change-Id: I6e7620948086f3f620e4cde778a4144570e1bd6d
Reviewed-on: https://pdfium-review.googlesource.com/3106
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Ue it to fix a typo as well.
BUG=pdfium:634
Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404
Reviewed-on: https://pdfium-review.googlesource.com/3113
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I2e1bc6cd8ba45fef2bde55bcc3f0c19947d46ed5
Reviewed-on: https://pdfium-review.googlesource.com/3111
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The spec says the N dictionary field is required and must be set to
a valid value. Adjust the code based on this assertion.
BUG=pdfium:675,chromium:691967,chromium:702238
Change-Id: Iaa76fa0e16ce4aaa9822ad471668cbf8af5fb7cb
Reviewed-on: https://pdfium-review.googlesource.com/3112
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
m_LineArray only grows via push_back of non-null pointer, so
remove some null checks.
Another little idiosyncrasy is CLines::Clear() doesn't clear the
items in CLines, only the things that were once in CLines but aren't
anymore. So don't call it.
Change-Id: Icc434be94b1b0522533c7533b8f6b2736bb864c4
Reviewed-on: https://pdfium-review.googlesource.com/3099
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
In agg, the length is of type coord_type, which we have as int16. So having
points bigger than the max short will not work properly.
BUG=chromium:699982
Change-Id: I0e4cab6ae2b6aa023359aec4b5b3d611f8a8eb4f
Reviewed-on: https://pdfium-review.googlesource.com/3101
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
When a web link has a hyphen at the end of line, we consider it to
be continued to the next line. For example, "http://www.abc.com/my-\r\ntest"
should be extracted as "http://www.abc.com/my-test".
BUG=pdfium:650
Change-Id: I64a93d9c66faf2be0abdaf8cfe8ee496c435d0ca
Reviewed-on: https://pdfium-review.googlesource.com/3092
Commit-Queue: Wei Li <weili@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|