ata4 / disunity

An experimental toolset for Unity asset and asset bundle files.
The Unlicense
2.69k stars 662 forks source link

SerializedFileHeader.java Wrong type used for writing? #180

Open anthony-de-jong opened 8 years ago

anthony-de-jong commented 8 years ago

I was looking trough the code and saw the following in the "SerializedFileHeader.java " file:

public void read(DataReader in) throws IOException {
    metadataSize = in.readInt();
    ...
}

Nothing wrong with that, but when you look at the write function:

public void write(DataWriter out) throws IOException {
    out.writeUnsignedInt(metadataSize);
    ...
}

You see that it writes a unsigned int to the file, but you are reading a signed int. I think that the write function is incorrect, but I am not sure.