audit: lock DTS rate table, fix sniff overflow-scan, cover decrypt loss
Round-10 findings from the 10-phase release audit: - A finder claimed the DTS SFREQ→rate table was wrong at 11/12; verified it against ffmpeg's avpriv_dca_sample_rates (12k/24k/48k/96k/192k at 11-15) — the table is CORRECT. Added a test that locks the full table so it can't be mis-"fixed". - sniff_video_codec advanced 3 bytes after a matched start code, re-reading the code byte as an overlapping start code; skip the full 4-byte marker. - Guard the HD-DVD next_id title counter with saturating_add so a crafted disc with >65536 clips can't overflow (panic in debug). - Add a test that an undecryptable unit (DecryptFailed) is zero-filled and counted as loss through ExtractResult (complete=false, bytes_lost>0) — the recovery-seam consolidation folded that bucket into bytes_unreadable.
This commit is contained in:
+5
-3
@@ -152,7 +152,9 @@ fn sniff_video_codec(es: &[u8]) -> Option<Codec> {
|
||||
_ if (code & 0x9F) == 0x07 => saw_h264_sps = true,
|
||||
_ => {}
|
||||
}
|
||||
i += 3;
|
||||
// Skip the whole consumed `00 00 01 <code>` marker (4 bytes) so the
|
||||
// code byte isn't re-read as the start of an overlapping start code.
|
||||
i += 4;
|
||||
} else {
|
||||
i += 1;
|
||||
}
|
||||
@@ -423,7 +425,7 @@ impl Disc {
|
||||
content_format: ContentFormat::MpegPs,
|
||||
codec_privates: Vec::new(),
|
||||
});
|
||||
next_id += 1;
|
||||
next_id = next_id.saturating_add(1);
|
||||
}
|
||||
|
||||
// Every remaining clip is its own title (unchanged behaviour). Iterated in
|
||||
@@ -461,7 +463,7 @@ impl Disc {
|
||||
content_format: ContentFormat::MpegPs,
|
||||
codec_privates: Vec::new(),
|
||||
});
|
||||
next_id += 1;
|
||||
next_id = next_id.saturating_add(1);
|
||||
}
|
||||
titles
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user