Commit Graph

195 Commits

Author SHA1 Message Date
Rod f83a177390 Merge pull request #189 from drott/patch-1
Increase default max size for output to 128MB
2025-12-11 08:55:08 -08:00
Dominik Röttsches 65e54002cd Increase default max size for output to 128MB
We're experiencing users in Chrome that require larger decode sizes for their woff2 fonts. I suggest to increase this limit. Compare https://crbug.com/40233227
2025-12-11 11:11:29 +02:00
Rod 0f4d304faa Merge pull request #171 from davidben/fix-type-punning
Fix undefined type-punning when loading/storing words
2023-11-06 17:02:44 -08:00
David Benjamin 23a34adec3 Fix undefined type-punning when loading/storing words
Despite common practice, type-punning integer types out of buffers is
undefined in C and C++. It's both a strict aliasing violation on access,
and if the pointer isn't aligned, an alignment violation on cast. Being
undefined, the compiler is allowed to arbitrarily miscompile the code
when we rely on it.

Instead, the two legal ways to pull a uint32_t out of a buffer are to
either use memcpy, or load byte by byte and use shifts. In both cases,
a good compiler should be smart enough to recognize what we're doing and
generate reasonable code. Since there was already fallback code for the
latter (for a middle-endian architecture?), I went ahead and switched to
that.

This change is needed to fix UBSan violations in Chromium.
2023-10-26 10:16:05 -04:00
rsheeter 4721483ad7 Merge pull request #149 from garretrieger/overlap_bit
Add woff2 encoder/decoder support for overlapSimpleBitmap.
2022-03-30 08:59:13 -07:00
Garret Rieger 62ae7a4c1e Add woff2 encoder/decoder support for overlapSimpleBitmap.
overlapSimpleBitmap is a new field in the transformed glyf table (https://www.w3.org/TR/WOFF2/#glyf_table_format). It allows the overlap simple flag set on glyphs in the original font to be saved into the woff2 encoding.
2022-03-29 13:49:27 -07:00
rsheeter a0d0ed7da2 Merge pull request #114 from garretrieger/master
[subset] Check for overflow when decoding glyf.
2018-05-31 18:53:35 -07:00
Garret Rieger 3831354113 [subset] Check for overflow when decoding glyf. 2018-05-31 17:54:06 -07:00
rsheeter 5e5f2cf20d Merge pull request #110 from chrissimpkins/brotli-update
update brotli to v1.0.3
2018-03-19 08:52:23 -07:00
Chris Simpkins 0a89801030 update brotli to v1.0.3 2018-03-16 16:41:02 -04:00
Rod Sheeter 1bccf208bc Set version to 1.0.2 2017-11-13 10:31:28 -08:00
rsheeter 5bbcf1f8ad Merge pull request #98 from rsheeter/master
Fix woff2_compress fuzzer bugs
2017-10-13 13:16:02 -07:00
Rod Sheeter 677800fa54 Fix woff2_compress fuzzer bugs 2017-10-13 13:12:55 -07:00
rsheeter 550cfa6433 Merge pull request #95 from tpopela/pkg-config-requires
Require specific brotli libraries in pkg-config files
2017-10-09 09:02:45 -07:00
Rod Sheeter c9ad29d349 Correct setup of ARFLAGS 2017-10-09 08:58:19 -07:00
Tomas Popela aff949b847 Require specific brotli libraries in pkg-config files
Before this change:
$ pkg-config --libs libwoff2dec
-lwoff2dec

after:
$ pkg-config --libs libwoff2dec
-lwoff2dec -lbrotlidec
2017-10-09 16:30:36 +02:00
Rod Sheeter b677a07ffd Set CMakeLists.txt version to 1.0.1 so I can release 1.0.1 and have them match 2017-10-06 08:17:35 -07:00
rsheeter 22c256bc45 Merge pull request #92 from rsheeter/master
Add support for the CMake build system.
2017-10-05 16:24:29 -07:00
Frédéric Wang ed27db0b91 Add support for the CMake build system.
This brings various improvements to the current Makefile and intends to help
people to package WOFF2:

* Build and install static and shared libraries for encoder and decoder
* Install public headers
* Generate and install pc files for PkgConfig
* Build the woff2_* programs
* Build the fuzzer archives
* Specify a release version (0.0.1 is hardcoded for now)
* Build using a Brotli version installed on the system, instead of the git
  submodule
* Have some CANONICAL_PREFIXES and NOISY_LOGGING configuration options
2017-10-05 16:18:39 -07:00
rsheeter 3060d8b232 Merge pull request #91 from rsheeter/master
Move public headers into a separate include/woff2 directory
2017-10-05 15:48:19 -07:00
Frédéric Wang 9b5a53b1d7 Move public headers into a separate include/woff2 directory
This is a first step to make WOFF2 a shared library. Public headers are moved
in their own directory to make the public API clearer. This is similar to
the c/include/brotli/ directory in Brotli. "using" commands are also removed
from the public headers, so that callers won't have unexpected side effect
when including the files.
2017-10-05 12:04:24 -07:00
rsheeter 914faa323d Merge pull request #72 from JLHwung/fix-macos-compilation-error
remove illegal `-f' ar option on Darwin
2017-10-05 11:27:29 -07:00
rsheeter 4995570f3e Merge pull request #90 from rsheeter/master
Relicense as MIT
2017-10-05 11:25:27 -07:00
Rod Sheeter 53846e1861 Relicense as MIT 2017-10-04 16:12:46 -07:00
rsheeter 0e9850d992 Merge pull request #86 from eustas/brotli-v1
Pull brotli v1.0.1
2017-10-04 10:57:11 -07:00
Eugene Kliuchnikov f07f3fb803 Pull brotli v1.0.0 2017-09-25 11:12:52 +02:00
rsheeter aa283a500a Merge pull request #85 from rsheeter/master
Refuse to decode woff2 files with bounding boxes for empty glyphs
2017-08-23 14:05:59 -07:00
Rod Sheeter 679771f97a Reject fonts with bounding boxes for empty glyphs 2017-08-23 14:03:23 -07:00
Rod Sheeter f3f2f0104f ignore woff2_info binary 2017-08-23 14:03:23 -07:00
rsheeter be080b644e Merge pull request #84 from rsheeter/master
Reject fonts with bad loca origLength or hmtx reserved bits set. Fix a misplaced bracket.
2017-08-23 13:04:11 -07:00
Rod Sheeter e6579e6b12 Reject fonts with bad loca origLength or hmtx reserved bits set. Correct misplaced bracket in type conversion. 2017-08-23 12:59:55 -07:00
rsheeter 36e6555b92 Merge pull request #81 from rsheeter/master
Check glyf/loca pairing for TTC and check glyf/loca matching transform status
2017-07-31 09:22:05 -07:00
Rod Sheeter 2e09253456 Check for non-consecutive glyf/loca. Reject inconsistent xform flags on glyf/loca 2017-07-31 09:16:49 -07:00
Rod Sheeter 2c6c5846dd reminder to update fuzzer on change 2017-07-31 09:14:44 -07:00
rsheeter 7dfff0003d Merge pull request #80 from rsheeter/master
Add woff2_info util
2017-07-27 09:46:26 -07:00
Rod Sheeter a3c61ecad8 Add woff2_info 2017-07-27 09:37:28 -07:00
rsheeter e580ebc30a Merge pull request #78 from garretrieger/master
Various crash fixes for encoder and decoder, mostly found by fuzzing.
2017-07-24 08:38:14 -07:00
Garret Rieger 44ab8c45d7 Fix a crash bug in the woff2 decoder when totalSfntSize in the woff2 header is <= 0. 2017-07-19 17:35:57 -07:00
Garret Rieger 849bdb0d24 Fix a crash in the woff2 encoder when it encounters a loca table with a length of zero. 2017-07-19 17:35:13 -07:00
Garret Rieger 4f659ddbad Allow endian-aware optimizations only on whitelisted CPUs. 2017-07-19 17:34:24 -07:00
Garret Rieger 12141fdaf2 Support tables with 0 length (which previously failed in multiple places). 2017-07-19 17:32:38 -07:00
Rod Sheeter cbea7b962e Make it possible to disable noisy logging in support of #348 2017-03-06 10:30:05 -08:00
rsheeter 68e9ab5d45 Merge pull request #75 from eustas/master
Fix fuzzer library linkage (missing dictionary.o)
2017-02-25 09:17:42 -08:00
Eugene Kliuchnikov a9d21c7d0b Fix fuzzer library linkage (missing dictionary.o) 2017-02-25 18:05:38 +01:00
rsheeter 49abfeab8a Merge pull request #68 from eustas/master
Roll new brotli version
2017-02-23 13:09:31 -08:00
rsheeter cdd19711f4 Merge branch 'master' into master 2017-02-23 13:09:01 -08:00
rsheeter 14715c32c2 Merge pull request #74 from rsheeter/master
Avoid shadowing
2017-02-23 10:45:24 -08:00
Rod Sheeter 086bc06ce9 Avoid shadowing 2017-02-23 10:29:01 -08:00
Rod Sheeter 82a9f3afb2 Add check for size of head table to woff2 enc 2017-02-15 13:52:56 -08:00
J Huang 58bb16a546 remove illegal `-r' ar option on Darwin 2017-02-12 10:41:15 +08:00