Prevent .zip files containing no valid files from causing crash

This commit is contained in:
mart0258 2010-05-25 03:20:48 +00:00
parent 68e300e7a2
commit b33b01febd
1 changed files with 3 additions and 1 deletions

View File

@ -218,7 +218,9 @@ static FCEUFILE * TryUnzip(const std::string& path) {
if(unzGoToNextFile(tz)!=UNZ_OK)
{
if(unzGoToFirstFile(tz)!=UNZ_OK) goto zpfail;
break;
unzCloseCurrentFile(tz);
unzClose(tz);
return 0;
}
}
if(unzOpenCurrentFile(tz)!=UNZ_OK)