From b33b01febdd6459809bf0ec89ac064554ba5601d Mon Sep 17 00:00:00 2001 From: mart0258 Date: Tue, 25 May 2010 03:20:48 +0000 Subject: [PATCH] Prevent .zip files containing no valid files from causing crash --- src/file.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.cpp b/src/file.cpp index e3a7bb8f..e3787b17 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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)