obs-ffmpeg: Fix a crash with invalid URL

This fixes a crash when an invalid URL is used.

Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
pkv
2025-08-22 19:07:21 -04:00
committed by Ryan Foster
parent 651544a487
commit 467967eab6
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -341,11 +341,21 @@ static inline int connect_mpegts_url(struct ffmpeg_output *stream, bool is_rist)
if (err < 0)
goto fail;
else
stream->has_connected = true;
return 0;
fail:
if (uc)
stream->has_connected = false;
if (uc) {
if (is_rist)
librist_close(uc);
else
libsrt_close(uc);
av_freep(&uc->priv_data);
}
av_freep(&uc);
#if HAVE_WINSOCK2_H
WSACleanup();
+1
View File
@@ -120,6 +120,7 @@ struct ffmpeg_output {
pthread_t start_stop_thread;
pthread_mutex_t start_stop_mutex;
volatile bool start_stop_thread_active;
bool has_connected;
#endif
};