From 0fbaac9c891055796456df7b9122a70c220f9ca1 Mon Sep 17 00:00:00 2001 From: Josscii Date: Wed, 23 Oct 2024 20:14:03 +0800 Subject: [PATCH] whisper : fix index overflow in token-level timestamp logic (#2505) --- 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;