gpac: add extension-aware demux/render harnesses and seed corpora#65
Open
tc-agent wants to merge 2 commits into
Open
gpac: add extension-aware demux/render harnesses and seed corpora#65tc-agent wants to merge 2 commits into
tc-agent wants to merge 2 commits into
Conversation
Fuzzing Coverage ReportTested: project
Per-harness
Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0. |
tc-agent
force-pushed
the
improve-gpac-fuzzing-coverage
branch
from
May 27, 2026 06:33
06e09b0 to
08626a8
Compare
tc-agent
force-pushed
the
master
branch
5 times, most recently
from
May 27, 2026 16:16
b5fd10c to
712a52f
Compare
tc-agent
force-pushed
the
improve-gpac-fuzzing-coverage
branch
from
May 27, 2026 16:42
08626a8 to
05e4872
Compare
tc-agent
force-pushed
the
master
branch
6 times, most recently
from
May 28, 2026 18:05
af7f9a7 to
806b281
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The five existing GPAC OSS-Fuzz harnesses all write their input to a
file at
/tmp/libfuzzer.<pid>with no extension and then feed itthrough a full GPAC filter session. Because GPAC's text and scene
source filters (
load_bt_xmt,load_svg,dashin,hlsin,nhml,...) declare their inputs by extension via
CAP_STRING(... GF_PROP_PID_FILE_EXT, "bt|xmt|wrl|x3d|x3dv|swf|..."), none of thosefilters can ever be selected from the upstream harnesses. Per
Fuzz Introspector,
the project overall sits at 15.84% line coverage (78,594 / 496,264);
fuzz_scene1.03%,fuzz_route1.44%,fuzz_parse3.87%, andfuzz_m2ts_probe0.07% all reflect that most of the GPAC source treeis unreachable from the current harness set.
Changes
Two extension-aware harnesses (added to
projects/gpac/harnesses/and compiled by
build.sh, alongside the upstreamtestsuite/oss-fuzzers/loop):
fuzz_demux.creads the first input byte as an index into a63-entry extension table, writes the rest to
/tmp/fzd_<pid>.<ext>, and runsgf_fs_load_source+inspect:deep:analyze=bs. This unlocks the text/scene sourcefilters that are unreachable from
fuzz_probe_analyze.fuzz_render.cuses the same selector byte but routes the input toan
.mp4destination viagf_fs_load_destination. The sessionresolver inserts the compositor (for scene sources) or the
reframe-and-mux chain (for media sources), exercising
filters/mux_isom.c,isomedia/isom_write.c, the compositor, andthe scene-graph node constructors — none of which are reachable
from the inspect-only harnesses. A
fuzz_render.optionsfiledisables libFuzzer leak detection because the GPAC filter session
retains ~96 B of long-lived state at teardown that the run-shutdown
leak check otherwise flags on every input.
Both harnesses use a pthread watchdog that calls
gf_fs_abortafter7–10 seconds so unbounded scene animations and DASH/HLS manifests
cannot stall the session past libFuzzer's per-input timeout.
Self-contained seed generator (
projects/gpac/gen_fuzz_seeds.py,invoked from
build.sh): synthesises small, probe-valid files for~40 container, codec and scene formats (WAV, AIFF, AVI, FLV, OGG /
Opus, MPEG-PS / TS / M2TS, MKV / WebM, FLAC, AC-3, DTS, GIF, BMP, AMR,
NHML, raw H.264 / HEVC, ADTS-AAC, M4V, M1V, ISOBMFF with rich box
trees, DASH MPD, HLS M3U8, SVG, BIFS-text, XMT, ...) and reuses the
real media samples that already live in
testsuite/media/auxiliary_files/plus a selection of the scene assets under
testsuite/media/{bifs, laser,svg,x3d}/. The generator writes one<harness>_seed_corpus.zipper broad harness into$OUT. Nobinary blobs are committed to oss-fuzz — every byte is either
generated by the Python script or sourced from the testsuite
submodule that the Dockerfile already pulls.
The upstream harness build loop in
build.shis left untouched; thenew code is appended after it and only adds new files. The existing
fuzz_parse_seed_corpus.zipproduced by the upstream loop isoverwritten by the generator with a superset (still ISOBMFF-only and
≤64 KiB, matching the
fuzz_parse65,536-byte cap).Coverage
Baseline numbers are taken from
https://introspector.oss-fuzz.com/project-profile?project=gpac
(retrieved while preparing this PR): 15.84% overall, with the
existing harnesses at 12.52% (
fuzz_probe_analyze), 3.87%(
fuzz_parse), 1.44% (fuzz_route), 1.03% (fuzz_scene), and 0.07%(
fuzz_m2ts_probe).After 5 minutes of libFuzzer per harness, running all harnesses
concurrently with the standard OSS-Fuzz
run_fuzzerdriver, thecoverage build (
infra/helper.py coverage) reports a harness-excludedglobal line coverage of 19.56% (97,093 / 496,380) — a +3.72-point
absolute lift on the baseline (a ~24% relative increase in lines
covered). The single new
fuzz_renderharness alone reaches 15.70%line coverage on the same corpus.
Selected per-file moves (FI baseline → this PR, coverage build):
compositor/compositor.cscene_manager/loader_xmt.cscene_manager/loader_bt.cscenegraph/mpeg4_nodes.cscenegraph/svg_attributes.cfilters/mux_isom.cisomedia/isom_write.cquickjs/quickjs.cmedia_tools/av_parsers.cThe dominant remaining 0%-covered files are GPAC components that need
either a graphical backend (most of
compositor/svg_*.c, much ofevg/), encoders compiled against libraries not present in theOSS-Fuzz base-builder (
filters/ff_*, dasher's segmented output), oroperations beyond demux/remux (network downloaders, ROUTE demux, the
TS muxer). Reaching them is not addressed by this PR.