Never crash: reject timeline documents nested too deeply

FCP 7 XML / FCPXML nested about 1 000 elements deep overflowed an 8 MiB stack in the XML
parser (aborting the app). Import now scans XML and OTIO JSON nesting first and returns
Error::TooDeep beyond 256 levels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-04 14:05:57 -04:00
co-authored by Claude Opus 5.5
parent ed54a8cd15
commit ad5aa542b4
3 changed files with 107 additions and 0 deletions
+2
View File
@@ -158,6 +158,8 @@ pub enum Error {
UnknownFormat,
#[error("no composition {0}")]
NoComp(u64),
#[error("the timeline document nests more than {0} levels deep")]
TooDeep(usize),
}
pub type Result<T> = std::result::Result<T, Error>;