Skip to content

deps.ffmpeg: Update libsrt to v1.5.7 - #1

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:deps/srt-1.5.7
Oct 25, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:deps/srt-1.5.7

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Description

Update libsrt from v1.5.2 to v1.5.7 in deps.ffmpeg (macOS 60-srt.zsh, Windows 60-srt.ps1).

  • Version, URLs and checksums now point to v1.5.7. The old v1.5.2 checksum files are replaced by v1.5.7.tar.gz.sha256 and v1.5.7.zip.sha256.
  • 0001-enable-proper-cmake-build-types.patch (macOS): restored the v1.5.4 version that deps.ffmpeg: Revert libsrt to v1.5.2 with patches obsproject/obs-deps#295 reverted for v1.5.2, rebased onto v1.5.7. The change is the same; only the line numbers differ. It is still needed because v1.5.7 still sets CMAKE_BUILD_TYPE from ENABLE_DEBUG on non-MSVC generators.
  • 0002-update-mbedtls-discovery-windows.patch (Windows): rebased onto v1.5.7 so it applies with no fuzz, since the context lines moved. The change is the same. The resulting mbedTLS block is identical to what v1.5.2 got with 0002+0003+0004.
  • 0003/0004 (mbedTLS 3.5+ bcrypt fixes): removed. They were backports of Haivision/srt@7899f15 and Haivision/srt@618ddfe, which are in v1.5.4 and later. 0004 now reverse-applies cleanly to v1.5.7. 0003 would still apply, but it would add a second bcrypt entry.
  • Build options are unchanged: mbedTLS crypto backend, shared and static libraries, apps off, bonding and logging at their defaults, and CMAKE_POLICY_VERSION_MINIMUM=3.5 still set.

Motivation and Context

v1.5.2 is affected by three critical libsrt advisories:

Why 1.5.2 was pinned, and why that no longer applies. Upstream obs-deps went back to v1.5.2 twice:

  1. Revert "deps.ffmpeg: Update libsrt to 1.5.3" obsproject/obs-deps#240 reverted v1.5.3. On Windows, OBS froze when libsrt closed a connection (Crash when livestreaming using SRT obsproject/obs-studio#10256, [BUG] Deadlock at cleanup due to pending delivery. Haivision/srt#2841). The fix is [core] Overlapped send with 100 ms timeout on Windows. Haivision/srt#2834 (b1c0be20d2ef), first released in v1.5.4.
  2. deps.ffmpeg: Revert libsrt to v1.5.2 with patches obsproject/obs-deps#295 reverted v1.5.4. With v1.5.4, one SRT Media Source closing or failing to connect tore down every other SRT connection in the process (OBS 31.1.0 ships with libsrt 1.5.4 which breaks SRT Media Sources obsproject/obs-studio#12361, [BUG] Regression with commit bc2f48e057644ab9  Haivision/srt#3098). It came from Haivision/srt@bc2f48e and was fixed by Haivision/srt@dca5399b (#3109). #295 judged that patch too large to backport.

Both fixes are ancestors of the v1.5.7 tag (checked with the GitHub compare API: behind_by: 0 for each). The mbedTLS 3.5+ link problem that blocked v1.5.3 is fixed upstream from v1.5.4 on, so the 0003/0004 backports are no longer needed.

How Has This Been Tested?

Sources. Each v1.5.7 archive was downloaded twice, from two different GitHub archive URLs, and both copies were byte-identical:

  • v1.5.7.tar.gz: 017cd1e437ef2073a4dd10ddf7b55e86bc3d6ebac0393d13bd22f6a57055d32b
  • v1.5.7.zip: 2f87560102b95137e851b4e64909087bcbcd3cee13c7f354809804a3e29a0d85

Both archives extract to exactly the tree of tag v1.5.7 (commit 899348d8318e), compared file by file against a git clone of the tag. The release page publishes digests only for its binary installers, not for the source archives.

Patches. Each patch was applied to fresh copies of the v1.5.7 tree with GNU patch, the tool both build scripts use. 0001 and 0002 apply with --fuzz=0, and the HashSum/hash lines match the committed files.

Build (Linux x86_64, clang 22, CMake 4.4, Ninja). This reproduces the linux-x86_64 flags from utils.zsh/30-build.zsh and the configure arguments from 60-mbedtls.zsh and 60-srt.zsh:

  • mbedTLS 3.6.4 at the pinned commit c765c831, with the obs-deps patches 0001 and 0002 and the same options.
  • libsrt built three ways against it, Release, with configure, build and install all succeeding:
    • v1.5.2 with the current 0001 (baseline)
    • v1.5.7 with the new 0001 (the macOS patch set)
    • v1.5.7 with the new 0002 (the Windows patch set), which goes through the MbedTLS::mbedtls config-package path that Windows uses
  • v1.5.2 vs v1.5.7 comparison:
    • The CMake cache options match (ENABLE_SHARED/STATIC=ON, ENABLE_APPS=OFF, ENABLE_BONDING=OFF, ENABLE_LOGGING=ON, ENABLE_HEAVY_LOGGING=OFF, ENABLE_ENCRYPTION=ON, USE_ENCLIB=mbedtls). The only additions are new upstream options left at their defaults (ENABLE_EXAMPLES, ENABLE_MAXREXMITBW, both OFF).
    • The compile definitions match, apart from two new upstream feature checks (HAVE_PTHREAD_ATFORK, HAVE_PTHREAD_CONDATTR_SETCLOCK).
    • SONAME is still libsrt.so.1.5, with the same mbedTLS NEEDED entries and the same 77 exported srt_* symbols (none removed or added).
  • RelWithDebInfo configures the same on both versions: 0001 keeps the build type, and ENABLE_HEAVY_LOGGING=ON/NDEBUG come out the same.

libsrt's own tests. test-srt was built from the patched v1.5.7 tree with the same options plus ENABLE_UNITTESTS=ON. It needed USE_CXX_STD=17 because the system googletest 1.18 requires C++17, and that applies to this test build only. Result: 277/277 passed, 0 skipped, including the mbedTLS CRYSPR crypto tests.

Regression check for obs-studio#12361. A small C program follows FFmpeg's libsrt protocol, which calls srt_startup() on open and srt_cleanup() on close. Caller A connects to a separate listener process and sends. Caller B then either fails to connect (a dead port) or connects and closes. After that, A must still be SRTS_CONNECTED and able to send. Each case ran 3 times:

libsrt B fails to connect B connects, then closes
v1.5.2 (current) pass 3/3 pass 3/3
v1.5.4 (control) fail 3/3 (A's socket becomes invalid) fail 3/3
v1.5.7 (macOS patch set) pass 3/3 pass 3/3
v1.5.7 (Windows patch set) pass 3/3 pass 3/3

Not tested here. No Windows build was run: the Windows test machine was not available. The Windows close-freeze (obs-studio#10256) is Windows-only, so it has not been re-checked on hardware. That check is the first item in the follow-ups below. No macOS build was run either.

Follow-ups

  1. Cut a new obs-deps release that contains this change, so the CI-built Windows and macOS packages exist.
  2. In obs-studio, bump the deps version and hashes in CMakePresets.json to that release.
  3. Windows A/B product checks with the full app, comparing the current deps against the new release: SRT output (stream start/stop, including stopping a long stream to cover obs-studio#10256), SRT Media Sources (two sources with one hidden or with a dead URL, to cover obs-studio#12361), and encrypted (passphrase) streams.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

AI note: Claude Code (Claude Opus 5.5) wrote the patch changes, the checks, the commit message and this text under the submitter's direction, and ran the builds and tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

CI on this PR fails in two jobs, and neither failure is from the libsrt change:

  • Build FFmpeg for Windows (x64): fails inside libvpx 1.14.1 (deps.ffmpeg/30-libvpx.ps1, which this PR doesn't touch). The link step reports LNK1136: invalid or corrupt file on nasm-built objects such as x64\Debug\vpx\vpx_dsp_x86_add_noise_sse2_asm.obj under make -j${NUMBER_OF_PROCESSORS}. deps.ffmpeg: Update Mbed TLS to 3.6.7 #3 fails the same way, and libvpx builds before srt, mbedtls and librist, so none of the PRs' changes have been built on Windows yet. The script is identical to upstream obsproject/obs-deps. These three PRs seem to be the first Windows FFmpeg builds this fork has run in CI (master only runs the scheduled workflow), so the failure probably comes from the runner image (nasm or MSBuild version, parallel custom-build steps) rather than the script. Options: retry the job, build libvpx with make -j1, or pin nasm. That's your call, since it's a CI and build-script change.
  • Build FFmpeg for macOS (macos-arm64): fatal: unable to access 'https://gitlab.xiph.org/xiph/vorbis.git/': ... 502, an upstream outage while fetching libvorbis. A rerun should pass.

Update libsrt from v1.5.2 to v1.5.7 to fix three critical security
advisories (v1.5.2 is affected by all three):
 * GHSA-6xg9-784j-24rm (CVE-2026-55869): KMREQ/KMRSP stack-based buffer
   overflow, fixed in v1.5.6
   GHSA-6xg9-784j-24rm
 * GHSA-4mc6-qmpp-g7gw (CVE-2026-55868): encryption state machine
   downgrade, fixed in v1.5.6
   GHSA-4mc6-qmpp-g7gw
 * GHSA-m96h-3rc9-xx6h: heap buffer overflow, fixed in v1.5.7
   GHSA-m96h-3rc9-xx6h

libsrt was pinned to v1.5.2 because of two upstream regressions, both
of which are fixed in v1.5.7:
 * v1.5.3 froze OBS Studio on Windows when closing an SRT connection
   (obsproject/obs-studio#10256, Haivision/srt#2841), which led to
   obsproject/obs-deps#240. Fixed by Haivision/srt#2834
   (b1c0be20d2ef7d4d1ec9897eb49c194ea7c98993), first released in v1.5.4.
 * v1.5.4 made one SRT Media Source closing or failing to connect tear
   down every other SRT connection in the process
   (obsproject/obs-studio#12361, Haivision/srt#3098), which led to
   obsproject/obs-deps#295. Fixed by Haivision/srt@dca5399b5257 (#3109).

Patch changes:
 * 0001-enable-proper-cmake-build-types: Restore the v1.5.4 version of
   the patch that obsproject/obs-deps#295 reverted for v1.5.2, rebased
   onto v1.5.7 (same change, new line numbers). Still needed: v1.5.7
   still sets CMAKE_BUILD_TYPE from ENABLE_DEBUG on non-MSVC generators.
 * 0002-update-mbedtls-discovery-windows: Rebase onto v1.5.7, where the
   context lines moved. The changes are the same, and the resulting
   mbedTLS block matches what v1.5.2 got with patches 0002-0004.
 * 0003/0004 (mbedTLS 3.5+ bcrypt fixes): Remove them. Their combined
   change (Haivision/srt@7899f15 and Haivision/srt@618ddfe) is in v1.5.4
   and later.

Build options are unchanged: mbedTLS crypto backend, shared and static
libraries, apps off, bonding and logging at their defaults, and
CMAKE_POLICY_VERSION_MINIMUM=3.5 still set (from b1d8b0e).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe

rdoupe commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto master (now includes #5, the libvpx/NASM 3.02 Windows fix that this PR's earlier Windows failures came from); head is 8a36c5b.

@rdoupe

rdoupe commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

After the rebase all jobs pass, Windows x64/arm64 and macOS included (21/21; Universal is the expected skip). Ready for review.

@zackees zackees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review: LGTM. libsrt 1.5.2 -> 1.5.7: new tarball/zip checksums, patches 0003/0004 dropped (the mbedtls 3.5+ fixes are upstream in 1.5.7), 0001/0002 re-hashed. Every build job passed after the rebase onto #5, which verifies the checksums and patch application. Verdict: approve.

@zackees
zackees merged commit c2ca0bd into obs-rust:master Oct 25, 2026
22 checks passed
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Ready to merge to Done in obs-rust Multiview Oct 25, 2026
zackees added a commit to obs-rust/obs-deps-buildstream that referenced this pull request Oct 25, 2026
* Update libsrt to v1.5.7

Update libsrt from v1.5.3 to v1.5.7 (commit 899348d8318e, tag v1.5.7)
for three critical public advisories:
 * GHSA-6xg9-784j-24rm (CVE-2026-55869): KMREQ/KMRSP stack-based
   buffer overflow, fixed in v1.5.6
 * GHSA-4mc6-qmpp-g7gw (CVE-2026-55868): encryption state machine
   downgrade, fixed in v1.5.6
 * GHSA-m96h-3rc9-xx6h: heap buffer overflow, fixed in v1.5.7

0001-enable-proper-cmake-build-types.patch does not apply to v1.5.7.
It is now the same file as in obs-rust/obs-deps (rebased onto v1.5.7
in obs-rust/obs-deps#1), so both repositories carry one patch. The
change is the same for the non-Debug build types; for Debug it keeps
v1.5.7's rule that _DEBUG needs ENABLE_ASSERT.

The build options are unchanged.

Refs obs-rust/obs-studio#2372

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update Mbed TLS to 3.6.7

Update Mbed TLS from 3.6.4 to 3.6.7 (release tarball
mbedtls-3.6.7.tar.bz2, SHA-256 a7e8bcbec0e6...) for the public
advisories that affect the RTMPS client, as obs-rust/obs-deps#3 did
for Windows and macOS. 0001-array-bounds-error-fix.patch still
applies.

Refs obs-rust/obs-studio#1121

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Zachary Vorhies <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants