Skip to content

Commit

Permalink
whisper : fix index overflow in token-level timestamp logic (#2505)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josscii authored Oct 23, 2024
1 parent a5abfe6 commit 0fbaac9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0fbaac9

Please sign in to comment.