diff --git a/src/resourcepacks/ZippedResourcePack.php b/src/resourcepacks/ZippedResourcePack.php index d67a205fc..2ec39445b 100644 --- a/src/resourcepacks/ZippedResourcePack.php +++ b/src/resourcepacks/ZippedResourcePack.php @@ -64,6 +64,13 @@ class ZippedResourcePack implements ResourcePack{ if(!file_exists($zipPath)){ throw new ResourcePackException("File not found"); } + $size = filesize($zipPath); + if($size === false){ + throw new ResourcePackException("Unable to determine size of file"); + } + if($size === 0){ + throw new ResourcePackException("Empty file, probably corrupted"); + } $archive = new \ZipArchive(); if(($openResult = $archive->open($zipPath)) !== true){