libobs: Fix a potential divide by zero crash

This commit is contained in:
Zachary Lund 2017-08-03 15:43:59 -07:00 committed by Michael Fabian Dirks
parent 13542166ce
commit 9941ddb52c

View File

@ -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;
}