From 9941ddb52c084ecfbcc9355accce1f465d625314 Mon Sep 17 00:00:00 2001 From: Zachary Lund Date: Thu, 3 Aug 2017 15:43:59 -0700 Subject: [PATCH] libobs: Fix a potential divide by zero crash --- libobs/obs-source.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 1578528f7..282c29b78 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1044,6 +1044,9 @@ void obs_source_video_tick(obs_source_t *source, float seconds) static inline uint64_t conv_frames_to_time(const size_t sample_rate, const size_t frames) { + if (!sample_rate) + return 0; + return (uint64_t)frames * 1000000000ULL / (uint64_t)sample_rate; }