diff options
author | jonmv <venstad@gmail.com> | 2022-10-25 11:46:18 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-10-26 12:07:17 +0200 |
commit | 74ab1c364fb11c46811cc12ed92807d06da674ff (patch) | |
tree | 3f33db9f5719bc20beecc81a84ce5da9a6645bbc /vespajlib/src/main/java/com/yahoo/compress | |
parent | a845add7c80c437d410a91da28dff6357304e748 (diff) |
Correctly throw on Integer.MIN_VALUE, in IntegerCompressor
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/compress')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/compress/IntegerCompressor.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/compress/IntegerCompressor.java b/vespajlib/src/main/java/com/yahoo/compress/IntegerCompressor.java index 982ca309015..fada7243b95 100644 --- a/vespajlib/src/main/java/com/yahoo/compress/IntegerCompressor.java +++ b/vespajlib/src/main/java/com/yahoo/compress/IntegerCompressor.java @@ -14,6 +14,7 @@ public class IntegerCompressor { int negative = n < 0 ? 0x80 : 0x0; if (negative != 0) { n = -n; + if (n == -n) --n; // underflow, caught as "too big" later. } if (n < (0x1 << 5)) { byte b = (byte)(n | negative); |