From 721308cb8e9a948c2a87134ff6caf286f4a75da7 Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:44:23 -0700 Subject: [PATCH] Fix UDF file data reads: use partition_start not metadata_start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File data extents are in the physical partition (partition_start + lba), not the metadata partition. ICBs (directory/file entries) are in metadata, but the data they point to is in physical. This one-line fix makes all MPLS playlists readable — previously only 1/18 had correct MPLS magic. Tested on Civil War UHD: 18 playlists, main movie at 00400.mpls (57min, 6 clips). --- src/udf.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/udf.rs b/src/udf.rs index 1edb33b..9b91145 100644 --- a/src/udf.rs +++ b/src/udf.rs @@ -87,9 +87,11 @@ impl UdfFs { let (data_lba, data_len) = self.read_icb_extent(session, entry.meta_lba)?; // Read file data sector by sector + // File DATA is in the physical partition (partition_start + lba), + // NOT the metadata partition. ICBs are in metadata, data is in physical. let sector_count = ((data_len as u64 + 2047) / 2048) as u32; let mut data = vec![0u8; (sector_count as usize) * 2048]; - let abs_start = self.meta_to_abs(data_lba); + let abs_start = self.partition_start + data_lba; for i in 0..sector_count { let offset = (i as usize) * 2048;