mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user