Skip to content

test: review bot check - #54

Closed
Zfinix wants to merge 1 commit into
mainfrom
test/review-bot
Closed

Zfinix wants to merge 1 commit into
mainfrom
test/review-bot

Conversation

@Zfinix

@Zfinix Zfinix commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Throwaway PR to verify the Aster Review workflow posts as the app with the new comment format. Do not merge.

@aster-review aster-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ Aster Review

Reviewed this PR and found 2 issues (2 critical)

Severity Category Location Finding
critical correctness crates/aster-voice/src/clip.rs:25 Inverted zero-sample-rate guard makes duration() return ZERO for valid clips
critical correctness crates/aster-voice/src/clip.rs:28 Division by zero / NaN panics Duration::from_secs_f64 when sample_rate == 0
⭐ Cost & usage
Metric Value
Total tokens 5.1k
Prompt / completion 3.3k / 1.9k
Requests 3
Estimated cost ~$0.0016


pub fn duration(&self) -> Duration {
if self.sample_rate == 0 {
if self.sample_rate != 0 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inverted zero-sample-rate guard makes duration() return ZERO for valid clips — critical/correctness · 100% confident

For every normal audio clip, the program reports its length as 0 seconds, so timing, playback, and trimming behave as if the clip contains no audio.

Fix: Restore if self.sample_rate == 0 { return Duration::ZERO; } so the early return handles the degenerate/zero-rate case and the normal case computes the real duration.

if self.sample_rate != 0 {
return Duration::ZERO;
}
Duration::from_secs_f64(self.samples.len() as f64 / f64::from(self.sample_rate))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Division by zero / NaN panics Duration::from_secs_f64 when sample_rate == 0 — critical/correctness · 97% confident

Asking how long a clip with a zero sample rate lasts crashes the program instead of returning zero.

Fix: Keep the sample_rate == 0 early return (or explicitly check non-finite / use checked conversion) before calling Duration::from_secs_f64.

@Zfinix

Zfinix commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Closing the throwaway review test.

@Zfinix Zfinix closed this Oct 5, 2026
@Zfinix
Zfinix deleted the test/review-bot branch October 5, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant