mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 22:34:24 +02:00
enforce ValueItem byte size at least 8
This commit is contained in:
parent
499701c3bc
commit
94e6772e75
@ -173,17 +173,28 @@ import java.io.IOException;
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onReadBytes(BlockReader reader) throws IOException {
|
public void onReadBytes(BlockReader reader) throws IOException {
|
||||||
initializeBytes(reader);
|
int readSize = initializeBytes(reader);
|
||||||
super.onReadBytes(reader);
|
super.onReadBytes(reader);
|
||||||
|
if(readSize<8){
|
||||||
|
setBytesLength(this.sizeOffset + 8, false);
|
||||||
|
writeSize();
|
||||||
|
}
|
||||||
onDataLoaded();
|
onDataLoaded();
|
||||||
}
|
}
|
||||||
private void initializeBytes(BlockReader reader) throws IOException {
|
private int initializeBytes(BlockReader reader) throws IOException {
|
||||||
int position = reader.getPosition();
|
int position = reader.getPosition();
|
||||||
int offset = this.sizeOffset;
|
int offset = this.sizeOffset;
|
||||||
reader.offset(offset);
|
reader.offset(offset);
|
||||||
int size = reader.readUnsignedShort();
|
int readSize = reader.readUnsignedShort();
|
||||||
|
int size = readSize;
|
||||||
|
if(size<8){
|
||||||
|
if(reader.available()>=8){
|
||||||
|
size = 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
reader.seek(position);
|
reader.seek(position);
|
||||||
setBytesLength(offset + size, false);
|
setBytesLength(offset + size, false);
|
||||||
|
return readSize;
|
||||||
}
|
}
|
||||||
public String getValueAsString(){
|
public String getValueAsString(){
|
||||||
StringItem stringItem = getDataAsPoolString();
|
StringItem stringItem = getDataAsPoolString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user