josscii commited on
Commit
de79ec1
·
unverified ·
1 Parent(s): 3767b95

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

Browse files
Files changed (1) hide show
  1. src/whisper.cpp +1 -1
src/whisper.cpp CHANGED
@@ -7019,7 +7019,7 @@ static void whisper_exp_compute_token_level_timestamps(
7019
  k++;
7020
  }
7021
  tokens[j].t1 = sample_to_timestamp(k);
7022
- if (j < ns - 1 && tokens[j].t1 > tokens[j + 1].t0) {
7023
  tokens[j].t1 = tokens[j + 1].t0;
7024
  } else {
7025
  s1 = k;
 
7019
  k++;
7020
  }
7021
  tokens[j].t1 = sample_to_timestamp(k);
7022
+ if (j < n - 1 && tokens[j].t1 > tokens[j + 1].t0) {
7023
  tokens[j].t1 = tokens[j + 1].t0;
7024
  } else {
7025
  s1 = k;