mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2023-11-04 02:52:44 +03:00
whisper : fix bug in token sampling logic
Could overflow buffer
This commit is contained in:
@@ -2470,7 +2470,7 @@ int whisper_full(
|
||||
result_all.push_back({ t0, t1, text });
|
||||
}
|
||||
text = "";
|
||||
while (result_cur[i].id > whisper_token_beg(ctx) && i < (int) result_cur.size()) {
|
||||
while (i < (int) result_cur.size() && result_cur[i].id > whisper_token_beg(ctx)) {
|
||||
i++;
|
||||
}
|
||||
i--;
|
||||
|
||||
Reference in New Issue
Block a user