mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use Stream extension to ensure read operations return the requested number of bytes (unless EOF arrives first).
This commit is contained in:
@@ -37,6 +37,7 @@ using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
public sealed partial class Gdi
|
||||
{
|
||||
@@ -48,7 +49,7 @@ public sealed partial class Gdi
|
||||
{
|
||||
imageFilter.GetDataForkStream().Seek(0, SeekOrigin.Begin);
|
||||
var testArray = new byte[512];
|
||||
imageFilter.GetDataForkStream().Read(testArray, 0, 512);
|
||||
imageFilter.GetDataForkStream().EnsureRead(testArray, 0, 512);
|
||||
imageFilter.GetDataForkStream().Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Check for unexpected control characters that shouldn't be present in a text file and can crash this plugin
|
||||
|
||||
Reference in New Issue
Block a user