Garret Rieger
8b686afeb5
[subset] add unlikely().
4 years ago
Garret Rieger
64122b5a44
[subset] don't visit lookup if covered glyph set has failed.
...
If covered glyph set is in error then the same lookup can be recursed into repeatedly potentially causing a fuzzer timeout. Fixes: https://oss-fuzz.com/testcase-detail/5416421032067072 .
4 years ago
Garret Rieger
4ec18c85e6
[subset] add subsetting tests with drop hints and layout subsetting enabled.
4 years ago
Garret Rieger
6f98a8ed46
[subset] Anchor should only use format 1 when hints are dropped.
...
Refactor Anchor to have a subset method instead of copy. This also allows
use to use serialize_subset in several places which simplifies calculating
offset bases.
4 years ago
Garret Rieger
71d6d15600
[subset] clamp distance to prevent shifting outside of the limits of int64.
...
Fixes https://oss-fuzz.com/testcase-detail/4961171477233664 .
4 years ago
Khaled Hosny
fcacd17748
[ot] Update _hb_glyph_info_is_default_ignorable_and_not_hidden()
...
Used _hb_glyph_info_substituted() similar to the change made to
_hb_glyph_info_is_default_ignorable() in
7686ff854b
.
4 years ago
Garret Rieger
596f4258d0
[subset] copy Lookup::markFilteringSet when subseting.
4 years ago
Behdad Esfahbod
d3a2f999e4
Fix up build
...
This was left out; oops.
4 years ago
Garret Rieger
c35d786397
[subset] never drop the 'pref' feature.
...
Never ever drop feature 'pref', even if it's empty. Harfbuzz uses it to choose the shaper for Khmer.
4 years ago
Behdad Esfahbod
092094f705
Use as_array() and range loops in a few places
4 years ago
Garret Rieger
55e7f3fe32
[subset] Match FeatureVariationRecord dropping from fontTools.
...
Only drop records with no matching features that are at the end of the list. See: cab7d13dc0
4 years ago
Garret Rieger
f0c78e0282
[subset] don't drop features referenced in a feature variation substitution.
4 years ago
Garret Rieger
dae99b7769
[subset] don't keep FeatureVariationRecord's with no subsittutions.
4 years ago
Garret Rieger
85b0728783
Add full variable font subsetting test.
4 years ago
Behdad Esfahbod
c4b49075f6
Update CMakeLists.txt
...
Keep the warning.
4 years ago
Timo Suoranta
9945f32746
Test fix to export target include directories
4 years ago
Garret Rieger
b10741ca7f
[subset] when closing glyphs in context lookups don't use a current glyph set if a lookup is already applied.
4 years ago
Garret Rieger
2773d05740
[subset] Add a test case using NotoNastaliqUrdu.
4 years ago
Garret Rieger
8ef4257dc8
[sanitize] change max ops to track number of bytes processed.
...
Counting bytes as the operations is likely to be a better proxy for how
much work processing the table will cost vs. the current approach of
counting the number of sub-objects.
This should allow checks for max features, max scripts, etc. to be removed.
I tested this change against the full collection of fonts at https://github.com/google/fonts
and a max ops factor of 3 was sufficient to successfully sanitize all of them.
4 years ago
Behdad Esfahbod
70110f6aaa
Modify OffsetTo<>::sanitize() overflow check
...
The code in question was introduced in 70eb2ff682
.
Rewrite it to not call sanitizer check_range() as we want to use
check_range() for byte accounting.
Part of https://github.com/harfbuzz/harfbuzz/pull/2923
4 years ago
Behdad Esfahbod
4dba749d83
Add SortedArray{16,32}Of<>
4 years ago
Behdad Esfahbod
5639e253f9
Add Array16Of<>
4 years ago
Behdad Esfahbod
2520a82df9
s/LArrayOf/Array32Of/g
4 years ago
Behdad Esfahbod
5efe360986
Rename (Unsized)OffsetListOf
4 years ago
Behdad Esfahbod
6c4e0491d7
s/OffsetArrayOf/Array16OfOffset16To/g
4 years ago
Behdad Esfahbod
1fc6b69aed
s/UnsizedOffsetArrayOf/UnsizedArray16OfOffsetTo/g
4 years ago
Behdad Esfahbod
2a54c9f744
.
4 years ago
Behdad Esfahbod
c539afb08b
[CFF] Use NNOffsetTo<> instead of OffsetTo<>
...
I'm pretty sure that's what is intended.
4 years ago
Behdad Esfahbod
9b4b58493b
Fixup for recent OffsetTo<> changes
4 years ago
Behdad Esfahbod
ad28f973f3
Rename offset types to be explicit about their size
...
Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
4 years ago
Garret Rieger
c5c13006a1
[subset] fix memory leaks found in https://oss-fuzz.com/testcase-detail/5179935334465536
4 years ago
Behdad Esfahbod
bd2950b393
Make VariationStore::get_delta(outer, inner) private
4 years ago
Behdad Esfahbod
934675a429
Use VarIdx in VariationDevice
4 years ago
Behdad Esfahbod
0f7f7536b9
[hvar] Change variation-index types from "unsigned int" to uint32_t
4 years ago
Behdad Esfahbod
9ffc46b8ff
Add VarIdx
4 years ago
Behdad Esfahbod
2179281c40
Add Offset24
4 years ago
Behdad Esfahbod
b3159ed8d2
[util] Silence compiler warning
4 years ago
Andrzej Perczak
cab9d5a57d
hb-config: Include config-override earlier
...
Currently config-override.h is included at the end of this file. This caused a problem for me while undefing HB_DISABLE_DEPRECATED, namely HB_IF_NOT_DEPRECATED was defined before actual undef took place and broke the whole build. I believe it would break builds for some other defines, too. Moving config-override.h include right after predefined configs is more sane and fixes all potential problems with includes.
4 years ago
Garret Rieger
adca4ce071
[subset] fixes https://oss-fuzz.com/testcase-detail/6173520787800064 .
...
Caused by incorrect bounds check in glyph closure for context lookups.
4 years ago
Garret Rieger
9f77a0c1ff
[subset] use hb_set_clear to avoid calling clear() on null pool set.
4 years ago
Garret Rieger
752e393ad2
[subset] avoid calling clear on null pool set.
4 years ago
Behdad Esfahbod
9ed5f04a70
[subset] Simplify recent out-of-memory fixes
...
By checking return status of map->set().
4 years ago
Behdad Esfahbod
a8f9f85a91
[map] Return success from ->set()
4 years ago
Garret Rieger
8741914a80
[subset] fix memory leak when map insert fails.
4 years ago
Behdad Esfahbod
2397689387
Remove hb_success_t
...
Was not rolled-out yet. So just expand.
4 years ago
Behdad Esfahbod
7a2eda7817
Move code around
4 years ago
Behdad Esfahbod
bcb57dccaa
[sanitize] Add short-circuit to ArrayOfM1
...
Like the sibling ArrayOf types.
4 years ago
Garret Rieger
5b6da6d2f0
[subset] add fuzzer test case.
4 years ago
Garret Rieger
52df6b9fd8
[subset] check for set insertion success.
4 years ago
Garret Rieger
c6adb90a27
[subset] fix nullptr deref.
4 years ago