mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 06:14:25 +02:00
fix: read within limit #32
This commit is contained in:
parent
c83645d82e
commit
ce27a1bf4f
@ -91,7 +91,12 @@ public class FileChannelInputStream extends InputStream {
|
|||||||
if(this.bufferPosition < bufferLength){
|
if(this.bufferPosition < bufferLength){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
|
int length = buffer.length;
|
||||||
|
long available = totalLength - position;
|
||||||
|
if(length > available){
|
||||||
|
length = (int) available;
|
||||||
|
}
|
||||||
|
ByteBuffer byteBuffer = ByteBuffer.wrap(buffer, 0, length);
|
||||||
bufferLength = fileChannel.read(byteBuffer);
|
bufferLength = fileChannel.read(byteBuffer);
|
||||||
bufferPosition = 0;
|
bufferPosition = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user