Skip to content

Commit 821e0c8

Browse files
Guard against zero video dimensions in preview generation
A failed or missing analysis stores 0x0 dimensions, which reached VapourSynth as a cryptic "BlankClip: invalid width". Bail early with an actionable error telling the user to re-add the file. None still falls back to the 720x480 defaults; only an explicit Some(0) is rejected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d0b7753 commit 821e0c8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

worker/src/pipeline_executor.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,17 @@ impl PipelineExecutor {
723723
let width = job.input_width.unwrap_or(720);
724724
let height = job.input_height.unwrap_or(480);
725725

726+
// Guard against zero dimensions. A failed/missing analysis stores 0x0,
727+
// which otherwise reaches VapourSynth as a cryptic "BlankClip: invalid
728+
// width". Surface an actionable error instead. (0 only occurs for an
729+
// explicit Some(0); None already falls back to the defaults above.)
730+
if width == 0 || height == 0 {
731+
bail!(
732+
"Invalid video dimensions ({}x{}). The file may not have been analyzed correctly \u{2014} try removing it from the queue and re-adding it.",
733+
width, height
734+
);
735+
}
736+
726737
// Calculate start time (go back half the frames for temporal context)
727738
let start_time = (time_seconds - (num_frames as f64 / 2.0) * frame_duration).max(0.0);
728739

0 commit comments

Comments
 (0)