This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 8d01e55e1b4d162b040d2f62f2c5d40a441764d3
Author:     Romain Beauxis <[email protected]>
AuthorDate: Mon May 18 09:21:40 2026 -0500
Commit:     toots <[email protected]>
CommitDate: Thu Jun 11 14:06:20 2026 +0000

    tests/fate-run.sh: add run_with_patched_temp
---
 tests/fate-run.sh | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index dfc5647321..40a1e7fe2a 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -113,6 +113,35 @@ run_with_temp(){
     run $process_tmp $tmpfile
 }
 
+# Overwrite bytes at a specific offset in a binary file.
+# Usage: patch_bytes file offset octal-byte-string
+patch_bytes(){
+    file=$1
+    offset=$2
+    bytes=$3
+    printf "%b" "$bytes" |
+        dd of="$file" bs=1 seek="$offset" conv=notrunc 2>/dev/null
+}
+
+# Like run_with_temp but applies byte patches between creation and processing,
+# allowing on-the-fly generation of files with controlled header corruption.
+# Patches are trailing offset/bytes pairs; multiple pairs may be specified.
+# Usage: run_with_patched_temp create_cmd process_cmd ext [offset bytes ...]
+run_with_patched_temp(){
+    create_tmp=$1
+    process_tmp=$2
+    filext=$3
+    tmpfile=${outdir}/$test.$filext
+    cleanfiles="$cleanfiles $tmpfile"
+    shift 3
+    run $create_tmp $tmpfile || return 1
+    while [ $# -ge 2 ]; do
+        patch_bytes "$tmpfile" "$1" "$2"
+        shift 2
+    done
+    run $process_tmp $tmpfile
+}
+
 probefmt(){
     run ffprobe${PROGSUF}${EXECSUF} -bitexact -threads $threads -show_entries 
format=format_name -print_format default=nw=1:nk=1 "$@"
 }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to