From: Josscii Date: Wed, 23 Oct 2024 12:14:03 +0000 (+0800) Subject: whisper : fix index overflow in token-level timestamp logic (#2505) X-Git-Tag: upstream/1.7.4~321 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=0fbaac9c891055796456df7b9122a70c220f9ca1;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : fix index overflow in token-level timestamp logic (#2505) --- diff --git a/src/whisper.cpp b/src/whisper.cpp index 1cde0c94..834f09a2 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;