From 66cb455b99c613b66192ed708f558179f913fe3c Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 4 Jan 2025 02:59:11 +0000 Subject: [PATCH] [ISO9660] Fixed performance issue caused by reading the whole data previous to the asked offset. --- Aaru.Filesystems/ISO9660/File.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs index b750612ff..aec7a66af 100644 --- a/Aaru.Filesystems/ISO9660/File.cs +++ b/Aaru.Filesystems/ISO9660/File.cs @@ -485,7 +485,7 @@ ErrorNumber ReadWithExtents(long offset, long size, List<(uint extent, uint byte fileNumber, out byte[] buffer) { var ms = new MemoryStream(); - long currentFilePos = 0; + long currentFilePos = offset; for(var i = 0; i < extents.Count; i++) { @@ -496,8 +496,8 @@ ErrorNumber ReadWithExtents(long offset, long size, List<(uint extent, uint continue; } - long leftExtentSize = extents[i].size; - uint currentExtentSector = 0; + var currentExtentSector = (uint)(offset / 2048); + long leftExtentSize = extents[i].size - currentFilePos; while(leftExtentSize > 0) {