whisper : fix index overflow in token-level timestamp logic (#2505)

This commit is contained in:
Josscii 2024-10-23 20:14:03 +08:00 committed by GitHub
parent a5abfe6a90
commit 0fbaac9c89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;