diff options
author | Eugene Kliuchnikov <eustas.ru@gmail.com> | 2021-07-29 22:29:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 22:29:43 +0200 |
commit | 630b5084ee255549d25d6da7ec50b7a53861d95a (patch) | |
tree | 37df125945ae7eb37ae90db285de7cb9a5f2ee74 /java/org | |
parent | ce222e317e36aa362e83fc50c7a6226d238e03fd (diff) | |
download | brotli-630b5084ee255549d25d6da7ec50b7a53861d95a.zip brotli-630b5084ee255549d25d6da7ec50b7a53861d95a.tar.gz brotli-630b5084ee255549d25d6da7ec50b7a53861d95a.tar.bz2 |
Update (#914)
* slimmer stack frames in encoder
* fix MSAN problem in hasher_composite
(not dangerous, only in large_window mode)
* fix JNI decoder wrapper - power-of-two payloads fail to decode sometimes
* reformat polyfil.js and decode_test.js
Diffstat (limited to 'java/org')
-rw-r--r-- | java/org/brotli/wrapper/dec/Decoder.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/org/brotli/wrapper/dec/Decoder.java b/java/org/brotli/wrapper/dec/Decoder.java index 71b77e0..018317d 100644 --- a/java/org/brotli/wrapper/dec/Decoder.java +++ b/java/org/brotli/wrapper/dec/Decoder.java @@ -156,6 +156,15 @@ public class Decoder { totalOutputSize += chunk.length; break; + case NEEDS_MORE_INPUT: + // Give decoder a chance to process the remaining of the buffered byte. + decoder.push(0); + // If decoder still needs input, this means that stream is truncated. + if (decoder.getStatus() == DecoderJNI.Status.NEEDS_MORE_INPUT) { + throw new IOException("corrupted input"); + } + break; + default: throw new IOException("corrupted input"); } |