diff --git a/crates/raw/tests/it/cr3_variants.rs b/crates/raw/tests/it/cr3_variants.rs index fb6628561d..1da91d41cf 100644 --- a/crates/raw/tests/it/cr3_variants.rs +++ b/crates/raw/tests/it/cr3_variants.rs @@ -101,7 +101,10 @@ fn cr3_file(coding: &[u8], sample: &[u8]) -> Vec { let mut co64 = vec![0u8; 4]; co64.extend(1u32.to_be_bytes()); // entry count co64.extend([0u8; 8]); // sample offset, patched once the layout is known - let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); + // One sample in chunk 1, using sample description 1. The shared parser + // deliberately refuses sample access without this mapping. + let stsc: Vec = [0u32, 1, 1, 1, 1].into_iter().flat_map(u32::to_be_bytes).collect(); + let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsc", &stsc), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); let trak = box_bytes(b"trak", &box_bytes(b"mdia", &box_bytes(b"minf", &box_bytes(b"stbl", &tables)))); let mut file = box_bytes(b"ftyp", b"crx \0\0\0\x01crx isom"); file.extend(box_bytes(b"moov", &trak)); diff --git a/crates/raw/tests/it/crx_properties.rs b/crates/raw/tests/it/crx_properties.rs index 215f2c3405..5f99837394 100644 --- a/crates/raw/tests/it/crx_properties.rs +++ b/crates/raw/tests/it/crx_properties.rs @@ -399,7 +399,10 @@ fn track_box(entry: &[u8], offset: u64, size: u32) -> Vec { let mut co64 = vec![0u8; 4]; co64.extend(1u32.to_be_bytes()); co64.extend(offset.to_be_bytes()); - let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); + // One sample in chunk 1, using sample description 1. The shared parser + // deliberately refuses sample access without this mapping. + let stsc: Vec = [0u32, 1, 1, 1, 1].into_iter().flat_map(u32::to_be_bytes).collect(); + let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsc", &stsc), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); box_bytes(b"trak", &box_bytes(b"mdia", &box_bytes(b"minf", &box_bytes(b"stbl", &tables)))) } diff --git a/crates/raw/tests/it/robust.rs b/crates/raw/tests/it/robust.rs index 1d864da1df..41a4ef302e 100644 --- a/crates/raw/tests/it/robust.rs +++ b/crates/raw/tests/it/robust.rs @@ -202,7 +202,10 @@ mod cr3 { let mut co64 = vec![0u8; 4]; co64.extend(1u32.to_be_bytes()); co64.extend(offset.to_be_bytes()); - let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); + // One sample in chunk 1, using sample description 1. The shared parser + // deliberately refuses sample access without this mapping. + let stsc: Vec = [0u32, 1, 1, 1, 1].into_iter().flat_map(u32::to_be_bytes).collect(); + let tables = [box_bytes(b"stsd", &stsd), box_bytes(b"stsc", &stsc), box_bytes(b"stsz", &stsz), box_bytes(b"co64", &co64)].concat(); box_bytes(b"trak", &box_bytes(b"mdia", &box_bytes(b"minf", &box_bytes(b"stbl", &tables)))) }