From 984b86616d544de1ec3530875e2e067730387510 Mon Sep 17 00:00:00 2001 From: Aron Granberg Date: Sat, 3 Oct 2020 13:10:06 +0200 Subject: [PATCH] Limit frame length in UniformSourceIterator --- src/source/uniform.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/source/uniform.rs b/src/source/uniform.rs index 254fef8d..bd038921 100644 --- a/src/source/uniform.rs +++ b/src/source/uniform.rs @@ -57,7 +57,8 @@ where target_channels: u16, target_sample_rate: u32, ) -> DataConverter>>, D> { - let frame_len = input.current_frame_len(); + // Limit the frame length to something reasonable + let frame_len = input.current_frame_len().map(|x| x.min(32768)); let from_channels = input.channels(); let from_sample_rate = input.sample_rate();