Use Stream extension to ensure read operations return the requested number of bytes (unless EOF arrives first).

This commit is contained in:
2022-11-14 09:43:16 +00:00
parent f90cc6593f
commit 0eb589d785
178 changed files with 862 additions and 780 deletions

View File

@@ -35,6 +35,7 @@ namespace Aaru.DiscImages;
using System.IO;
using System.Linq;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
public sealed partial class Chd
{
@@ -44,7 +45,7 @@ public sealed partial class Chd
Stream stream = imageFilter.GetDataForkStream();
stream.Seek(0, SeekOrigin.Begin);
var magic = new byte[8];
stream.Read(magic, 0, 8);
stream.EnsureRead(magic, 0, 8);
return _chdTag.SequenceEqual(magic);
}