Fix Encoder bug

This commit is contained in:
Aayush Atharva 2023-12-28 22:19:02 +05:30 committed by GitHub
parent fef82ea104
commit 428d056ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,7 +227,7 @@ public class Encoder {
int totalOutputSize = 0;
try {
encoder.getInputBuffer().put(data, offset, length);
encoder.push(EncoderJNI.Operation.FINISH, data.length);
encoder.push(EncoderJNI.Operation.FINISH, length);
while (true) {
if (!encoder.isSuccess()) {
throw new IOException("encoding failed");