[低] CLI 的 --speed 0 会导致除零

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cyandee/BirdLock

All issues in cyandee/BirdLock

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.