Skip to content

AutoShorts is a local-first desktop application for turning long-form video or audio recordings into high-impact, vertical short-form clip candidates (9:16 portrait) with AI-powered viral moment ranking.

Rust

fix: sanitize font file paths to prevent shell injection and format errors in ffmpeg commands

JayWebtech0035074d801d
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 63308ea..567d3d4 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -893,7 +893,12 @@ fn build_drawtext_filters(
let mut font_option = String::new();
for path in &font_paths {
if std::path::Path::new(path).exists() {
- font_option = format!("fontfile='{}':", path.replace(':', "\\:"));
+ let escaped_path = path
+ .replace('\\', "\\\\")
+ .replace(':', "\\:")
+ .replace('\'', "\\'")
+ .replace(' ', "\\ ");
+ font_option = format!("fontfile={}:", escaped_path);
break;
}
}