Skip to content

Commit 30d6043

Browse files
authored
Prevent infinite loop for out-of-bound timestamps in clip_timestamps (#697)
Same as openai/whisper#2005
1 parent 22c75d0 commit 30d6043

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

faster_whisper/transcribe.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ def generate_segments(
471471
# while seek < seek_clip_end
472472
while clip_idx < len(seek_clips):
473473
seek_clip_start, seek_clip_end = seek_clips[clip_idx]
474+
if seek_clip_end > content_frames:
475+
seek_clip_end = content_frames
474476
if seek < seek_clip_start:
475477
seek = seek_clip_start
476478
if seek >= seek_clip_end:

0 commit comments

Comments
 (0)