snappy-java icon indicating copy to clipboard operation
snappy-java copied to clipboard

Snappy.maxCompressedLength can return a negative size

Open bersprockets opened this issue 7 months ago • 1 comments

This is applicable to snappy-java-1.1.10.7.jar.

bash-3.2$ jshell --class-path /Users/<redacted>/jars/snappy-java-1.1.10.7.jar
|  Welcome to JShell -- Version 21.0.6
|  For an introduction type: /help intro

jshell> import org.xerial.snappy.Snappy;
import org.xerial.snappy.Snappy;

jshell> Snappy.maxCompressedLength(1840700246);
Snappy.maxCompressedLength(1840700246);
$2 ==> -2147483644

jshell> 

This could very well be an appropriate response. But I wanted to verify before I file an issue with a second library which assumes that the result of Snappy.maxCompressedLength is always usable as a buffer size.

bersprockets avatar Jul 13 '25 00:07 bersprockets