[低] CLI 的 --speed 0 会导致除零
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in windows/birdlock/cli.py around line 221, where main() parses --speed without a range check, then read windows/birdlock/core/render.py:66-78 where step = s.speed * source_fps / outputFPS feeds (n-1)/step. Add speed > 0 and outputFPS > 0 validation both in the CLI and where ExportSettings is loaded, so library callers are covered too. Done means running birdlock export --speed 0 ... (and an outputFPS=0 case) fails with a clear error message instead of ZeroDivisionError. Note the report is from a code audit, not reproduced on Windows, so verify the paths first.
Written by the indexing model from the issue text.
Description
位置:windows/birdlock/cli.py:221;windows/birdlock/core/render.py:66-78
现象:main() 未校验 --speed 范围,step = s.speed * source_fps / outputFPS 后 (n-1)/step 会 ZeroDivisionError;outputFPS=0 同样除零。
复现:birdlock export --speed 0 ...。
建议:在 CLI 与 ExportSettings 加载时校验 speed > 0、outputFPS > 0。
来源:2026-11-15 全仓只读审计,PR #7 未包含此项。 未在 Windows 实机复现,复现路径由代码审计推得。
- Dominant language
- Swift
- Stars
- 2
- Forks
- 2
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cyandee/BirdLock
-
Difficulty 2/5 Under an hour Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100