Merge PR #3015: Never crash: an oversize export size is an error, not a multiply overflow

crates/engine/src/media.rs: main moved render_now and export_job to media/session.rs; the two size checks ported there
crates/engine/src/tests_export.rs: the test is appended to tests/export.rs
This commit is contained in:
aiongg
2026-10-31 02:08:30 +00:00
4 changed files with 34 additions and 1 deletions
+4 -1
View File
@@ -599,7 +599,10 @@ pub fn render(
};
let plan = lightcraft_pipeline::plan(src, info, s, req);
let (w, h) = (plan.w, plan.h);
let n = w * h;
let Some(n) = w.checked_mul(h).filter(|n| n.checked_mul(12).is_some()) else {
fail(FailKind::Limit, format!("{w}×{h} output is too large"));
return None;
};
let _limit = match fault {
Some(crate::Fault::Limit(bytes)) => Some(crate::ctx::LimitOverride::new(bytes)),
_ => None,