Skip to content

fix(kdenlive): reject negative and non-finite seconds in timecode_to_seconds - #599

Open
kevin9327 wants to merge 1 commit into
HKUDS:mainfrom
kevin9327:fix/kdenlive-reject-negative-time
Open

kevin9327 wants to merge 1 commit into
HKUDS:mainfrom
kevin9327:fix/kdenlive-reject-negative-time

Conversation

@kevin9327

Copy link
Copy Markdown

timecode_to_seconds in the kdenlive harness (behind parse_time, which the CLI uses for clip in/out points and similar times) tried float(tc) first and returned whatever came back. So "-5", "nan" and "inf" were accepted as timeline positions and written into the project, even though seconds_to_timecode in the same module already rejects negative seconds.

Fix: after the float() fast path, raise ValueError for non-finite or negative values. The HH:MM:SS.mmm path can't produce these and is unchanged.

Test: test_timecode_to_seconds_rejects_negative_and_non_finite (5 cases) in kdenlive/agent-harness/cli_anything/kdenlive/tests/test_core.py fails before and passes after. All 116 tests in that file pass.

AI-assistance note: I found and wrote this change with help from an AI coding assistant. I reviewed it and ran the tests myself.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T03:15:06.269598Z 3ad27b3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the existing-cli-fix Fixes or improves an existing CLI harness label Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

existing-cli-fix Fixes or improves an existing CLI harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant