forge
Explore
Log in

Don't you dare go Hollow

ec-ogg test: damage comment matches the three-quarter offset (first audio page is not the one damaged)

Browse files at this commit

397395d3756c9481ea1e9155e26b47f314f0cf3eAhmet Kaan GümüşParent: c8c31df
crates/ec-ogg/tests/ogg.rsmodified+3 -2
@@ -341,8 +341,9 @@ fn damage_costs_one_page_and_no_more() {
341 let (_, clean, _) = demux_all(path);341 let (_, clean, _) = demux_all(path);
342 let bytes = std::fs::read(path).unwrap();342 let bytes = std::fs::read(path).unwrap();
343 343
344- // Flip a bit in the middle of the file: that lands inside a page body, so344+ // Flip a bit three quarters in: past the header pages and inside an audio
345- // the page's checksum fails and its packets are lost — and nothing else is.345+ // page with audio on both sides, so the page's checksum fails and its
346+ // packets are lost — and nothing else is.
346 let mut damaged = bytes.clone();347 let mut damaged = bytes.clone();
347 let at = damaged.len() * 3 / 4;348 let at = damaged.len() * 3 / 4;
348 damaged[at] ^= 0x40;349 damaged[at] ^= 0x40;