diff --git a/lib/ZipFile/ZipFile.cpp b/lib/ZipFile/ZipFile.cpp index a740e14d..58fa64d5 100644 --- a/lib/ZipFile/ZipFile.cpp +++ b/lib/ZipFile/ZipFile.cpp @@ -332,6 +332,7 @@ int ZipFile::fillUncompressedSizes(std::vector& targets, std::vector file.seek(zipDetails.centralDirOffset); int matched = 0; + const int targetCount = static_cast(targets.size()); uint32_t sig; char itemName[256]; @@ -372,6 +373,10 @@ int ZipFile::fillUncompressedSizes(std::vector& targets, std::vector } ++it; } + + if (matched >= targetCount) { + break; + } } else { file.seekCur(nameLen); }