Fix path traversal, encoding, and edge case bugs

This commit is contained in:
2026-03-07 20:49:10 +02:00
parent 9e1562c4c4
commit 150d483fbe
14 changed files with 207 additions and 106 deletions

View File

@@ -282,7 +282,7 @@ pub fn build_adjustments_page(state: &AppState) -> adw::NavigationPage {
return;
}
let idx = pidx.get().min(loaded.len() - 1);
let idx = pidx.get().min(loaded.len().saturating_sub(1));
pidx.set(idx);
let path = loaded[idx].clone();
let name = path.file_name().and_then(|n| n.to_str()).unwrap_or("image");