mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 17:01:17 +01:00
The raster backend lets push_transform() fail under the fuzzing failing- allocator path, but pop_transform() always removed the current stack entry. That can discard the base transform when a nested push did not actually land, corrupting subsequent raster operations. Guard pop_transform() so it only removes nested transforms and preserves the base transform frame. Tested: - meson compile -C build hb-raster-fuzzer Speculative fix for: https://oss-fuzz.com/testcase-detail/4743569679384576 Assisted-by: OpenAI Codex
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: