src/hb-sanitize.hh

Branch


Log

Author Commit Date CI Message
Behdad Esfahbod 47089fe7 2025-05-28T17:10:22 Big misc changes - Make geometry types into templates taking float or double. - Changes to paint() transform elimination. - Add font->has_nonzero_coords and use it across. - Extensions to avar processing for otherwise invalid mappings.
Behdad Esfahbod a9c2c635 2025-06-04T11:58:20 [sanitize] Fix pointer math Should fix https://github.com/harfbuzz/harfbuzz/issues/5347
Behdad Esfahbod 633290dc 2025-03-03T14:51:09 [hvgl] Reuse sanitizer object
Behdad Esfahbod 6ce9a207 2025-03-02T16:57:50 [hvgl] Hook up to hb-ot-font for get_path() Does nothing yet.
Khaled Hosny fc42cdd6 2025-01-08T22:17:03 [docs] Reduce warnings
Behdad Esfahbod d053426b 2023-11-06T11:44:14 Format
Behdad Esfahbod 30672c7e 2023-11-03T18:52:03 Add hb_barrier() And annotate some more.
Behdad Esfahbod cf49f3f2 2023-11-03T18:20:14 [sanitize] Add barrier()
Behdad Esfahbod b16f1800 2023-11-03T17:51:50 [sanitize] Yet another hack to "fix" barrier issue
Bruce Mitchener f380a328 2023-08-25T14:01:01 Fix some typos.
Behdad Esfahbod 25e9defa 2023-07-31T17:12:07 [sanitize] Inline check_struct Though seems like the compiler was always inlining it anyway.
Behdad Esfahbod 36c7ec44 2023-07-20T18:56:46 [sanitize] Simplify a return
Behdad Esfahbod 837885f0 2023-07-20T12:58:16 Revert "[sanitize/Coverage] Keep a map of sane coverages" This reverts commit a689114898cc3e8f1c6ba7cc49cd6c3639d91250.
Behdad Esfahbod 0ab90671 2023-07-20T12:57:16 [sanitize/Coverage] Keep a map of sane coverages Fonts like Gulzar reuse the same coverage over a thousand times sometimes. However, this doesn't speed up sanitize unfortunately. Looks like calling Coverage::sanitize() is already very fast. We're just doing A LOT of it. The map slowed it down in fact. A set was even slower. Going to revert.
Behdad Esfahbod 253ec08b 2023-07-08T12:48:05 [sanitize] Speed up check_struct on x64
Behdad Esfahbod fb02f4a8 2023-07-08T12:29:18 [sanitize] Micro-optimize ChainRule::sanitize
Behdad Esfahbod 73ee9c34 2023-07-07T22:47:20 Revert "[sanitize] Only check trailing edge of ranges" This reverts commit e4856cf8098b9741a910e7f7979096cf11d8fead. This is wrong on at least 32-bit systems. Might add a condition version later.
Behdad Esfahbod d8450420 2023-07-07T21:56:17 [sanitize] Optimize away an overflow check when not needed When the length argument is 16bit...
Behdad Esfahbod e4856cf8 2023-07-07T21:21:33 [sanitize] Only check trailing edge of ranges Assumptions... Speeds up Gulzar load_face_and_shape benchmark by 7%.
Behdad Esfahbod 6a683ea6 2023-07-07T21:02:15 [sanitize] Enlighten check_range() some more No need to check for len=0 arrays. They must still be in range.
Behdad Esfahbod c24ea103 2023-07-07T20:43:20 [sanitize] Minor tweak to len=0 case which is handled otherwise anyway
Behdad Esfahbod 59abcda2 2023-07-07T14:27:18 [sanitize] Add an ALWAYS_INLINE Looks like it was always inlined anyway.
Behdad Esfahbod 5ac9eaa0 2023-07-02T16:18:08 [sanitize] Minor micro-optimize
Behdad Esfahbod bb33675e 2023-07-02T14:11:40 [sanitize] Micro-optimize check_range()
Behdad Esfahbod d1c82a1c 2023-07-02T13:38:22 [sanitize] Speed up check_struct() Don't account for length here. Should not be a problem. Fingers crossed fuzzers. 18% speed up in load_face_and_shape Gulzar-Regular.
Behdad Esfahbod 2d6091fc 2023-06-30T11:48:56 [GPOS] Make AnchorMatrix sanitize lazy again Was reverted in the previous commit, because it was incomplete.
Behdad Esfahbod 83eb744e 2023-06-30T11:33:39 [sanizie] Inline check_range if not OPTIMIZE_SIZE BM_Font/load_face_and_shape/NotoNastaliqUrdu-Regular.ttf/hb -0.1046 -0.1051 194 173 193 172 BM_Font/load_face_and_shape/NotoSerifMyanmar-Regular.otf/hb -0.2401 -0.2412 36 27 36 27
Behdad Esfahbod 690af7aa 2023-06-30T10:36:01 [GPOS] Sanitize Device tables lazily This speeds up face loading for variable fonts by 80%! Comparing before to after Benchmark Time CPU Time Old Time New CPU Old CPU New --------------------------------------------------------------------------------------------------------------------------------------------------------------- BM_Font/load_face_and_shape/Roboto-Regular.ttf/hb -0.0368 -0.0366 20 20 20 19 BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/hb -0.7149 -0.7162 77 22 77 22 BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/var/hb -0.7241 -0.7255 80 22 79 22 BM_Font/load_face_and_shape/SourceSansPro-Regular.otf/hb -0.1441 -0.1445 28 24 28 24 BM_Font/load_face_and_shape/AdobeVFPrototype.otf/hb -0.7893 -0.7910 66 14 66 14 BM_Font/load_face_and_shape/AdobeVFPrototype.otf/var/hb -0.7865 -0.7882 67 14 66 14 BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/hb -0.8895 -0.8900 227 25 226 25 BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/var/hb -0.8895 -0.8900 226 25 225 25 BM_Font/load_face_and_shape/Comfortaa-Regular-new.ttf/hb -0.5512 -0.5531 42 19 42 19 BM_Font/load_face_and_shape/NotoNastaliqUrdu-Regular.ttf/hb -0.1511 -0.1510 227 192 225 191 BM_Font/load_face_and_shape/NotoSerifMyanmar-Regular.otf/hb -0.1494 -0.1498 41 35 40 34 OVERALL_GEOMEAN -0.6443 -0.6456 0 0 0 0
Behdad Esfahbod fe83736e 2023-03-02T11:35:42 [sanitize] Protect against an underflow
Garret Rieger 918193eb 2023-02-22T23:11:29 [subset] fix a class of fuzzer timeouts caused by large shared coverage tables. More acurately estimates the op count for CoverageFormat2 tables as the population size instead of the size in bytes.
Behdad Esfahbod 6b72a4dd 2023-01-23T18:36:04 Revert "[sanitize] Simplify(?) check_range" This reverts commit af0b1ef8a72d4f6b778dbba3606ebe7df39d5288.
Behdad Esfahbod af0b1ef8 2023-01-23T14:31:10 [sanitize] Simplify(?) check_range
Behdad Esfahbod ed023f66 2023-01-12T17:04:24 Enable -Wformat-signedness And fix the codebase.
Behdad Esfahbod 4c14043b 2022-11-21T12:56:33 [algs] Add output argument to hb_unsigned_mul_overflows()
Garret Rieger 64b29dbd 2021-11-09T09:13:14 [subset] reuse colrv1 max nesting depth constant for sanitize.
Garret Rieger ace98cc6 2021-11-08T15:47:56 [subset] Only sanitize recursion depth in COLR.
Garret Rieger 782a7377 2021-11-04T13:39:11 [sanitize] add a maximum recursion depth for sanitize.
Behdad Esfahbod 6d555ce8 2021-11-02T00:18:22 [meta] Use std::forward instead of hb_forward()
Garret Rieger 8ef4257d 2021-03-31T15:00:46 [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.
Behdad Esfahbod a650243d 2021-01-24T13:30:06 [sanitize] Fix typo
Khaled Hosny a8e72ee7 2020-12-30T23:08:40 [docs] Use %true and %false consistently
Behdad Esfahbod 1535440b 2020-06-19T08:30:59 [dispatch] Fix debug builds
Ebrahim Byagowi b398748d 2020-03-04T11:18:19 [algs] Add hb_clamp Similar to stl and glsl's clamp
Ebrahim Byagowi d3836039 2020-03-02T22:41:08 Limit OT::Lookup subtables (#2219) Fixes https://crbug.com/oss-fuzz/13943
Marcel Fabian Krüger b28c2825 2019-12-17T02:58:51 Check to avoid overflows
Marcel Fabian Krüger d70afb1e 2019-12-17T02:29:28 Clamp max_ops to upper bound in hb-sanitize.hh
Ebrahim Byagowi a0b4ac4d 2019-08-24T17:57:14 Turn 8 spaces to tab across the project According to the current code style of the project
Behdad Esfahbod 25a5b287 2019-05-10T16:01:39 Fix sanitize fail of extension sublookups Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=960331
Behdad Esfahbod 2ba984fc 2019-05-07T23:28:22 Fix signed comparison on 32bit
Behdad Esfahbod 83e3eabd 2019-05-07T20:58:43 Whitespace
Behdad Esfahbod 41248cce 2019-05-07T20:54:31 Remove MIN/MAX in favor of hb_min/hb_max
Behdad Esfahbod c14efb8e 2019-05-05T09:54:58 Fix previous commit Priority should be given to specific over dispatch. Broke sanitize before. This fixes it, by moving prioritization to the context implementation, since the correct priority cannot be done in the dispatch implementation. Done for subset and sanitize only, which need it.
Behdad Esfahbod b10f6593 2019-05-05T09:23:35 [dispatch] Use functionality from previous commit To remove a couple of unwanted wrapper methods
Behdad Esfahbod ac350c92 2019-05-05T09:10:46 [dispatch] Try obj.dispatch(c) before trying c->dispatch(obj)
Behdad Esfahbod a7c63cd8 2019-03-30T14:59:40 Split sanitize and dispatch into their own files