Skip to content

obs-ffmpeg: Clear RIST credentials on close so open failure frees them once (#482) - #705

Merged
zackees merged 3 commits into
masterfrom
fix/482-rist-open-cleanup
Oct 14, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/482-rist-open-cleanup

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #482
Refs #686

Fix by @chriscoveries (chriscoveries/obsrust-fork fix/rist-open-failure-cleanup), cherry-picked with -x, authorship kept.

librist_open closes the context on its failure paths, and connect_mpegts_url's fail path closes it again; librist_close freed secret/username/password without clearing the pointers, so the second close freed them again. The fix clears each pointer after bfree.

RED → GREEN

  • RED (rust/tools/linux-validate/run.sh, OFF and ON): test_rist_open_cleanup FAILED: encrypted_url_cleanup_test, parse_failure_cleanup_test, repeated_close_test (196/197).
  • GREEN: 197/197 OFF and ON, exported symbols IDENTICAL (1766). ./lint ok.

chriscoveries and others added 3 commits October 14, 2026 00:27
…them once (GREEN)

librist_open closes the context on its failure paths and connect_mpegts_url's fail path closes it again. librist_close released the secret, username and password without clearing the pointers, so the second close released the same strings again. Clear each pointer after release so close is idempotent.

(cherry picked from commit eb28de0)
cmocka's will_return/expect queues crashed inside _mock (strcmp) on the
MSVC Tier 2 build. Plain statics, like the rist_destroy counter, keep the
same checks on every platform.
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Windows Tier 2 crashed inside cmocka's _mock (strcmp) in parse_failure_cleanup_test/encrypted_url_cleanup_test; afd2e28 drives the parse stub with plain statics instead. Locally re-verified: RED (header fix reverted) 3 cases fail, GREEN 199/199 OFF and ON.

@zackees
zackees merged commit 1abf06f into master Oct 14, 2026
21 checks passed
@zackees
zackees deleted the fix/482-rist-open-cleanup branch October 14, 2026 07:58
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.

bug: obs-ffmpeg: a failed RIST open frees the stream credentials twice

2 participants