mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Catch errors when checking an AesXtsFile's size
This commit is contained in:
parent
0ed67d87df
commit
39f952015f
1 changed files with 13 additions and 6 deletions
|
@ -43,6 +43,8 @@ namespace LibHac.IO
|
||||||
}
|
}
|
||||||
|
|
||||||
private long GetAesXtsFileSize(string path)
|
private long GetAesXtsFileSize(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
using (IFile file = BaseFileSystem.OpenFile(path, OpenMode.Read))
|
using (IFile file = BaseFileSystem.OpenFile(path, OpenMode.Read))
|
||||||
{
|
{
|
||||||
|
@ -55,5 +57,10 @@ namespace LibHac.IO
|
||||||
return BitConverter.ToInt32(buffer, 0);
|
return BitConverter.ToInt32(buffer, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue