Handle negative value in padding (#3389)
Some checks failed
Bindings Tests (Ruby) / ubuntu-22 (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-cuda.Dockerfile platform:linux/amd64 tag:main-cuda]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-intel.Dockerfile platform:linux/amd64 tag:main-intel]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-musa.Dockerfile platform:linux/amd64 tag:main-musa]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main.Dockerfile platform:linux/amd64 tag:main]) (push) Has been cancelled
Examples WASM / deploy-wasm-github-pages (push) Has been cancelled

this might happen depending on the way the $stderr.winsize is defined. If the expression "$stderr.winsize[1] - line.size" in Line 114 gets negative, we will get a "negative argument" exception in the padding calculation
This commit is contained in:
Treboko 2025-08-24 18:34:23 +02:00 committed by GitHub
parent c09b0e0c4c
commit 7745fcf328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,7 +94,7 @@ module Whisper
end
def show_progress(current, size)
progress_rate_available = size && $stderr.tty?
progress_rate_available = size && $stderr.tty? && $stderr.winsize[1] >= line.size
unless @prev
@prev = Time.now