mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 05:51:05 +01:00
hb_raster_paint_glyph() took the palette index and foreground color as per-call arguments, duplicating state that also lives on the paint context (foreground via hb_raster_paint_set_foreground, palette previously only available as a per-call arg). This gave callers two paths for configuring the same state. Drop the per-call palette/foreground arguments and require callers to configure them via setters before painting, matching the already-established pattern in hb_vector_paint_glyph() and elsewhere in the subsystem. - Drop palette and foreground args from hb_raster_paint_glyph(). - Add hb_raster_paint_set_palette() / _get_palette() and a hb_raster_paint_get_foreground() companion. - Store palette on hb_raster_paint_t (default 0). - Update util/raster-output.hh, util/hb-raster-all.cc, and test/fuzzing/hb-raster-fuzzer.cc to the new API. - Update the hb-raster section-doc example. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
To build the fuzzers with libFuzzer to perform actual fuzzing, build with:
CXX=clang++ CXXFLAGS="-fsanitize=address,fuzzer-no-link" meson fuzzbuild --default-library=static -Dfuzzer_ldflags="-fsanitize=address,fuzzer"
ninja -Cfuzzbuild
Then, run the fuzzer like this:
fuzzbuild/test/fuzzing/hb-{shape,raster,vector,subset,set}-fuzzer [-max_len=2048] [CORPUS_DIR]
Where max_len specifies the maximal length of font files to handle. The smaller the faster.
For more details consult the following locations: