Add precursor position check for segment validity

This commit is contained in:
Matt Nadareski
2023-01-04 20:24:31 -08:00
parent 6037be404c
commit 8ebaa59b5f

View File

@@ -73,6 +73,10 @@ namespace BurnOutSharp.Wrappers
if (!DataSourceIsValid())
return false;
// If we have an invalid position
if (position < 0 || position >= GetEndOfFile())
return false;
switch (_dataSource)
{
case DataSource.ByteArray: