File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/java/net/litetex/capes/provider Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,16 @@ static ResolvedTextureInfo.ByteArrayTextureInfo resolveTextureDefault(
8686 .setMaxCount (DEFAULT_MAX_DOWNLOAD_BYTES )
8787 .get ())
8888 {
89- return new ResolvedTextureInfo .ByteArrayTextureInfo (
90- IOUtils .toByteArray (cappedIS ),
91- textureResolverId );
89+ final ResolvedTextureInfo .ByteArrayTextureInfo byteArrayTextureInfo =
90+ new ResolvedTextureInfo .ByteArrayTextureInfo (
91+ IOUtils .toByteArray (cappedIS ),
92+ textureResolverId );
93+ if (cappedIS .getCount () >= DEFAULT_MAX_DOWNLOAD_BYTES )
94+ {
95+ throw new IllegalStateException (
96+ "Aborted download because it exceeded the maximum allowed size: " + DEFAULT_MAX_DOWNLOAD_BYTES );
97+ }
98+ return byteArrayTextureInfo ;
9299 }
93100 }
94101 }
You can’t perform that action at this time.
0 commit comments