From 30d6043e90e963f2d378047a00bf53c4d958cac1 Mon Sep 17 00:00:00 2001 From: Purfview <69023953+Purfview@users.noreply.github.com> Date: Thu, 22 Feb 2024 08:48:35 +0000 Subject: [PATCH] Prevent infinite loop for out-of-bound timestamps in clip_timestamps (#697) Same as https://github.com/openai/whisper/pull/2005 --- faster_whisper/transcribe.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index 9b0ce6c..c1ea390 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -471,6 +471,8 @@ class WhisperModel: # while seek < seek_clip_end while clip_idx < len(seek_clips): seek_clip_start, seek_clip_end = seek_clips[clip_idx] + if seek_clip_end > content_frames: + seek_clip_end = content_frames if seek < seek_clip_start: seek = seek_clip_start if seek >= seek_clip_end: