From 2fdcdafa707d407ad2eb5d34b0c81816950f827b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 6 Jun 2016 19:05:26 +0200 Subject: [PATCH] Fix a possible int32 overload with huge framerate denominators. Found by Coverity Scan. --- mixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixer.cpp b/mixer.cpp index 19cb8be..80b0df1 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -359,7 +359,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, } } - int64_t frame_length = int64_t(TIMEBASE * video_format.frame_rate_den) / video_format.frame_rate_nom; + int64_t frame_length = int64_t(TIMEBASE) * video_format.frame_rate_den / video_format.frame_rate_nom; size_t num_samples = (audio_frame.len > audio_offset) ? (audio_frame.len - audio_offset) / audio_format.num_channels / (audio_format.bits_per_sample / 8) : 0; if (num_samples > OUTPUT_FREQUENCY / 10) { -- 2.39.2