From 6eac72d78c3bff76bfc599724a7703f3d6f3011b Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 26 Aug 2024 11:37:08 +0200 Subject: [PATCH] net/aws: fix sanity check in transcribe loop When we receive a new alternative we want to avoid iterating out of bounds, but the comparison between the current index and the length of the alternative should not log an error when partial_index == length, as Vec::drain(length..) is valid, and it is completely valid for AWS to send us a new alternative with as many items as we have already dequeued. Part-of: --- net/aws/src/transcriber/transcribe.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/aws/src/transcriber/transcribe.rs b/net/aws/src/transcriber/transcribe.rs index 02c983dae..10ed47637 100644 --- a/net/aws/src/transcriber/transcribe.rs +++ b/net/aws/src/transcriber/transcribe.rs @@ -237,7 +237,7 @@ impl TranscriberStream { mut items: Vec, partial: bool, ) -> Option> { - if items.len() <= self.partial_index { + if items.len() < self.partial_index { gst::error!( CAT, imp = self.imp,