From 032a3a559bd5f2cd6c6213dfb85ae8926efd92b3 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Fri, 21 Aug 2026 08:41:54 +0800 Subject: [PATCH] ci+tests: skip libopenh264 on MinGW; fix UB varargs in the message-suite test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FFmpeg for Windows no longer enables libopenh264 (redundant with the native h264 decoder + x264 encoder; its MinGW packaging does not satisfy the static link — Wels* undefined references) - suites_test's question-type call passed a 3-placeholder format with one variadic arg — UB that vsnprintf turns into a SIGSEGV on glibc (masked on macOS); use a placeholder-free format --- crates/oakplugin/tests/suites_test.rs | 7 +++++-- tooling/ffmpeg/build-ffmpeg.sh | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/oakplugin/tests/suites_test.rs b/crates/oakplugin/tests/suites_test.rs index c192fa81d..44994e8ec 100644 --- a/crates/oakplugin/tests/suites_test.rs +++ b/crates/oakplugin/tests/suites_test.rs @@ -579,15 +579,18 @@ fn message_suite_v1_v2() { OK ); } - // question 类型 + 无出口 → REPLY_NO(13)。 + // question 类型 + 无出口 → REPLY_NO(13)。用无占位符的格式串: + // 占位符没有对应的变长参数是 UB(glibc 上 vsnprintf 对野指针 + // strlen 直接 SIGSEGV;macOS 上恰好读到可映射内存才没崩)。 let q = cs("OfxMessageQuestion"); + let plain = cs("really?"); unsafe { assert_eq!( (s.message)( std::ptr::null_mut(), q.as_ptr(), id.as_ptr(), - fmt.as_ptr(), + plain.as_ptr(), 1 ), 13 diff --git a/tooling/ffmpeg/build-ffmpeg.sh b/tooling/ffmpeg/build-ffmpeg.sh index 3befa46a4..994ca79e5 100755 --- a/tooling/ffmpeg/build-ffmpeg.sh +++ b/tooling/ffmpeg/build-ffmpeg.sh @@ -138,7 +138,12 @@ if [ -d /opt/homebrew/lib/pkgconfig/openjpeg ]; then export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-}:/opt/homebrew/lib/pkgconfig/openjpeg" fi enable_if_pkg libopenjp2 libopenjpeg -enable_if_pkg openh264 libopenh264 +# openh264 is redundant for us (decode: FFmpeg's native h264; encode: +# x264) and its MinGW package does not satisfy the static link — skip it +# on Windows. +if [ -z "${MSYSTEM:-}" ]; then + enable_if_pkg openh264 libopenh264 +fi enable_if_pkg snappy libsnappy enable_if_pkg wavpack libwavpack enable_if_pkg webp libwebp