audit: bound DTS marks, align disc-format tree order, doc/test cleanups
Round-7 findings from the 10-phase release audit (no HIGH; convergence): - Cap DtsParser.pts_marks (MAX_PTS_MARKS): a run of zero-length timed PES packets grew no buffer bytes, so the drain_front mark-prune never ran — the deque could accumulate without bound on hostile PS input. - detect_disc_format tested HVDVD_TS before BDMV while the title-scan dispatch tests BDMV first, so a disc with both trees would be classified HD-DVD but enumerated as Blu-ray. Align both to BDMV → HVDVD_TS → VIDEO_TS. - Document why the DTS new-PES re-base can emit a locally-decreasing PTS (the muxer's block_ts applies the strictly-monotonic audio nudge, tested in mkv.rs) — this is by design, not a mux defect. - Fix stale aacs/keys.rs comment references (functions moved to aacs/inf.rs / aacs::resolve/derive in the module split).
This commit is contained in:
+2
-2
@@ -572,7 +572,7 @@ mod tests {
|
||||
}
|
||||
|
||||
/// A content certificate: type byte@0 (0x00 = V10, else V20),
|
||||
/// bus_encryption bit7@1, cc_id@14..20 (aacs/keys.rs parse_content_cert,
|
||||
/// bus_encryption bit7@1, cc_id@14..20 (aacs/inf.rs parse_content_cert,
|
||||
/// which requires ≥20 bytes and reads the bus flag from `data[1] >> 7`).
|
||||
fn build_content_cert(cert_type: u8, bus_encryption: bool) -> Vec<u8> {
|
||||
let mut v = vec![0u8; 20];
|
||||
@@ -584,7 +584,7 @@ mod tests {
|
||||
/// An MKB with one Type-and-Version record (type 0x10) carrying the
|
||||
/// version as BE u32 at record offset 8, followed by a recorded EOF
|
||||
/// record then trailing zero padding. mkb_content_len walks records
|
||||
/// and stops at the first padding (type 0) byte (aacs/keys.rs).
|
||||
/// and stops at the first padding (type 0) byte (aacs/inf.rs).
|
||||
fn build_mkb(version: u32, pad_to: usize) -> Vec<u8> {
|
||||
let mut v = Vec::new();
|
||||
// Type 0x10 record, length 16 (>= 12 so version is read).
|
||||
|
||||
+9
-6
@@ -2129,12 +2129,9 @@ impl Disc {
|
||||
titles: &[DiscTitle],
|
||||
) -> DiscFormat {
|
||||
use crate::aacs::mkb::{AacsVersion, mkb_type};
|
||||
if udf_fs.find_dir("/HVDVD_TS").is_some() {
|
||||
return DiscFormat::HdDvd;
|
||||
}
|
||||
if udf_fs.find_dir("/VIDEO_TS").is_some() {
|
||||
return DiscFormat::Dvd;
|
||||
}
|
||||
// Tree priority MUST match the title-scan dispatch (BDMV → HVDVD_TS →
|
||||
// VIDEO_TS): otherwise a disc carrying two trees would be classified as
|
||||
// one format but enumerated as another (e.g. BD titles tagged HdDvd).
|
||||
if udf_fs.find_dir("/BDMV").is_some() {
|
||||
// Only the Type-and-Version record (first record) is needed.
|
||||
if let Ok(mkb) = udf_fs.read_file_prefix(reader, "/AACS/MKB_RO.inf", 64) {
|
||||
@@ -2151,6 +2148,12 @@ impl Disc {
|
||||
other => other,
|
||||
};
|
||||
}
|
||||
if udf_fs.find_dir("/HVDVD_TS").is_some() {
|
||||
return DiscFormat::HdDvd;
|
||||
}
|
||||
if udf_fs.find_dir("/VIDEO_TS").is_some() {
|
||||
return DiscFormat::Dvd;
|
||||
}
|
||||
DiscFormat::Unknown
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user