Emulator Won't Crash When User Loads A State That Is Not Embedded To A Movie

This commit is contained in:
rolanmen1 2012-04-05 01:42:24 +00:00
parent 87b455b195
commit fd6a1a88da
1 changed files with 16 additions and 0 deletions

View File

@ -550,10 +550,26 @@ namespace BizHawk.MultiClient
}
}
private bool IsStateFromAMovie(StreamReader reader)
{
while (true)
{
if (reader.ReadLine().Contains("GUID"))
break;
if (reader.EndOfStream)
return false;
}
return true;
}
public bool CheckTimeLines(string path, bool OnlyGUID)
{
//This function will compare the movie data to the savestate movie data to see if they match
var reader = new StreamReader(path);
if (!IsStateFromAMovie(reader))
return false;
MovieLog l = new MovieLog();
string line;
string GUID;