Skip to content

Commit

Permalink
Remove redundant Stream.Read result check in LsmvImport
Browse files Browse the repository at this point in the history
fixes a7e1c8f
  • Loading branch information
YoshiRulz committed Jul 3, 2024
1 parent b818f53 commit da25438
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/BizHawk.Client.Common/movie/import/LsmvImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ protected override void RunImport()
using var fs = new FileStream(SourceFile.FullName, FileMode.Open, FileAccess.Read);
{
byte[] data = new byte[4];
var bytesRead = fs.Read(data, offset: 0, count: data.Length);
Debug.Assert(bytesRead == data.Length, "reached end-of-file while reading header");
_ = fs.Read(data, offset: 0, count: data.Length); // if stream is too short, the next check will catch it
if (!data.SequenceEqual(Zipheader))
{
Result.Errors.Add("This is not a zip file.");
Expand Down

0 comments on commit da25438

Please sign in to comment.