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
2021-04-01 15:26:02 -06:00
Garret Rieger
f0c78e0282
[subset] don't drop features referenced in a feature variation substitution.
2021-04-01 15:26:02 -06:00
Garret Rieger
dae99b7769
[subset] don't keep FeatureVariationRecord's with no subsittutions.
2021-04-01 15:26:02 -06:00
Garret Rieger
b10741ca7f
[subset] when closing glyphs in context lookups don't use a current glyph set if a lookup is already applied.
2021-03-31 21:03:33 -06:00
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.
2021-03-31 19:03:30 -06:00
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
2021-03-31 17:04:02 -06:00
Behdad Esfahbod
4dba749d83
Add SortedArray{16,32}Of<>
2021-03-31 16:09:39 -06:00
Behdad Esfahbod
5639e253f9
Add Array16Of<>
2021-03-31 16:04:43 -06:00
Behdad Esfahbod
2520a82df9
s/LArrayOf/Array32Of/g
2021-03-31 15:41:54 -06:00
Behdad Esfahbod
5efe360986
Rename (Unsized)OffsetListOf
2021-03-31 15:33:22 -06:00
Behdad Esfahbod
6c4e0491d7
s/OffsetArrayOf/Array16OfOffset16To/g
2021-03-31 15:31:32 -06:00
Behdad Esfahbod
1fc6b69aed
s/UnsizedOffsetArrayOf/UnsizedArray16OfOffsetTo/g
2021-03-31 15:30:35 -06:00
Behdad Esfahbod
2a54c9f744
.
2021-03-31 15:26:42 -06:00
Behdad Esfahbod
c539afb08b
[CFF] Use NNOffsetTo<> instead of OffsetTo<>
...
I'm pretty sure that's what is intended.
2021-03-31 13:28:25 -06:00
Behdad Esfahbod
9b4b58493b
Fixup for recent OffsetTo<> changes
2021-03-31 13:27:21 -06:00
Behdad Esfahbod
ad28f973f3
Rename offset types to be explicit about their size
...
Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
2021-03-31 13:00:07 -06:00
Garret Rieger
c5c13006a1
[subset] fix memory leaks found in https://oss-fuzz.com/testcase-detail/5179935334465536
2021-03-31 12:37:45 -06:00
Behdad Esfahbod
bd2950b393
Make VariationStore::get_delta(outer, inner) private
2021-03-31 11:36:36 -06:00
Behdad Esfahbod
934675a429
Use VarIdx in VariationDevice
2021-03-31 11:34:41 -06:00
Behdad Esfahbod
0f7f7536b9
[hvar] Change variation-index types from "unsigned int" to uint32_t
2021-03-31 11:31:49 -06:00
Behdad Esfahbod
9ffc46b8ff
Add VarIdx
2021-03-31 11:26:18 -06:00
Behdad Esfahbod
2179281c40
Add Offset24
2021-03-31 11:20:21 -06:00
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.
2021-03-30 20:50:02 -06:00
Garret Rieger
adca4ce071
[subset] fixes https://oss-fuzz.com/testcase-detail/6173520787800064 .
...
Caused by incorrect bounds check in glyph closure for context lookups.
2021-03-30 15:44:41 -06:00
Garret Rieger
9f77a0c1ff
[subset] use hb_set_clear to avoid calling clear() on null pool set.
2021-03-30 15:12:52 -06:00
Garret Rieger
752e393ad2
[subset] avoid calling clear on null pool set.
2021-03-30 15:12:52 -06:00
Behdad Esfahbod
9ed5f04a70
[subset] Simplify recent out-of-memory fixes
...
By checking return status of map->set().
2021-03-29 18:14:30 -06:00
Behdad Esfahbod
a8f9f85a91
[map] Return success from ->set()
2021-03-29 18:13:22 -06:00
Garret Rieger
8741914a80
[subset] fix memory leak when map insert fails.
2021-03-29 18:02:32 -06:00
Behdad Esfahbod
2397689387
Remove hb_success_t
...
Was not rolled-out yet. So just expand.
2021-03-29 17:49:16 -06:00
Behdad Esfahbod
7a2eda7817
Move code around
2021-03-29 17:49:12 -06:00
Behdad Esfahbod
bcb57dccaa
[sanitize] Add short-circuit to ArrayOfM1
...
Like the sibling ArrayOf types.
2021-03-29 17:49:08 -06:00
Garret Rieger
52df6b9fd8
[subset] check for set insertion success.
2021-03-29 17:41:07 -06:00
Garret Rieger
c6adb90a27
[subset] fix nullptr deref.
2021-03-29 17:41:07 -06:00
Garret Rieger
9a3537e5f6
[subset] invert err() return value. Undo previous change to check_success.
2021-03-29 17:15:22 -06:00
Garret Rieger
cdba5d44c2
[subset] fix incorrect handling of return value in check_success in the error case.
2021-03-29 17:15:22 -06:00
Behdad Esfahbod
05e845c49a
Make previous commit gcc-only
2021-03-29 16:02:10 -07:00
Behdad Esfahbod
b5e4032392
-Wno-unused-result
...
GCC doesn't let one turn off the warning using "(void) foo()".
People have introduced macros that do "unused << foo()" instead.
Until we do something similar, silence gcc.
Clang on the other hand understands "(void) foo()".
2021-03-29 15:57:36 -07:00
Qunxin Liu
95230e291d
[subset] support subsetting GSUB8
2021-03-29 15:54:11 -06:00
David Corbett
d18915f920
Reformat gen-tag-table.py
2021-03-28 10:21:46 -07:00
Garret Rieger
3c8273ab68
Check for alloc failures on the gsub/gpos_langsys maps in subset plan creation.
2021-03-25 16:53:56 -06:00
Behdad Esfahbod
29708e959a
[aat] Fix offsetToIndex math for out-of-bounds values
...
Previously, some bad font data was accidentally being interpretted as
legit if it happened to not fall out of memory bounds. The intention
of the code was what this commit does. I'm surprised we weren't getting
a "arithmetic between signed and unsigned values" warning / error
before.
2021-03-22 15:22:15 -07:00
Garret Rieger
46bf03d691
[subset] add NODISCARD to error checking methods on serializer.
2021-03-18 14:35:36 -07:00
Garret Rieger
3827a3eb56
[subset] rename serializer::set_error() to err().
2021-03-18 11:20:03 -07:00
Garret Rieger
f561fa6e4c
Change priority queue to use (priority, value) instead of (value, priority).
2021-03-18 11:13:47 -07:00
Garret Rieger
b14475d2ae
[subset] further changes to serializer error handling.
...
- Rename enum type and enum members.
- in_errors() now returns true for any error having been set. hb-subset now looks for offset overflow only errors to divert to repacker.
- Added INT_OVERFLOW and ARRAY_OVERFLOW enum values.
2021-03-18 10:51:26 -07:00
Garret Rieger
73ed59f7a6
[subset] store errors in the serializer as a flag set.
...
Make check_assign/check_equal specify the type of error to set.
2021-03-17 15:58:34 -07:00
Garret Rieger
b9ecc7420d
[subset] init offset_overflow in hb_serialize_context_t.
2021-03-17 15:53:58 -07:00
Garret Rieger
cf79fc342d
[subset] limit priority bumps to 16.
2021-03-17 15:53:58 -07:00
Garret Rieger
e2f14e81bd
[subset] fix memory leaks in test-repacker.
2021-03-17 15:53:58 -07:00