forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

seed.sh19 lines, 922 bytesHistoryRawDownload
1#!/usr/bin/env bash
2# seed.sh: fill fuzz/corpus/<target>/ from the repo's PGS fixture.
3#
4# fixtures/subs/pgs-1080p.sup is a real disc's display sets. segments gets the file's first 64 KiB
5# as is. compose and rle get the same bytes too; those two read their own input layouts, so the
6# seeds are mostly rejects, which still steer the mutator. Corpus lives under fuzz/corpus.
7set -euo pipefail
8
9FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd)
10ROOT=$(cd -- "$FUZZ_DIR/../../.." && pwd)
11SUBS="$ROOT/fixtures/subs"
12[ -f "$SUBS/pgs-1080p.sup" ] || { echo "seed.sh: $SUBS/pgs-1080p.sup missing; run scripts/link-fixtures.sh" >&2; exit 2; }
13
14CORPUS="$FUZZ_DIR/corpus"
15mkdir -p "$CORPUS"/{segments,rle,compose}
16head -c 65536 "$SUBS/pgs-1080p.sup" > "$CORPUS/segments/pgs-1080p"
17head -c 4096 "$SUBS/pgs-1080p.sup" > "$CORPUS/compose/pgs-1080p"
18head -c 4096 "$SUBS/pgs-1080p.sup" > "$CORPUS/rle/pgs-1080p"
19echo "ec-pgs seeds written"