From 9ca32661c6b3a3bd6b782da22bec58b787c4ea83 Mon Sep 17 00:00:00 2001 From: Josscii Date: Wed, 23 Oct 2024 20:05:18 +0800 Subject: [PATCH] whisper: fix index overflow --- src/whisper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/whisper.cpp b/src/whisper.cpp index 1cde0c94ec0..834f09a2539 100644 --- a/src/whisper.cpp +++ b/src/whisper.cpp @@ -7019,7 +7019,7 @@ static void whisper_exp_compute_token_level_timestamps( k++; } tokens[j].t1 = sample_to_timestamp(k); - if (j < ns - 1 && tokens[j].t1 > tokens[j + 1].t0) { + if (j < n - 1 && tokens[j].t1 > tokens[j + 1].t0) { tokens[j].t1 = tokens[j + 1].t0; } else { s1 = k;