-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BspSource: Decompiling error, caused by java.lang.IllegalArgumentException: newLimit #150
Comments
The link to the workshop map doesn't seem to work anymore. If you could update it, I would have look at it. |
@rihi I think I have a pretty similiar issue:
|
A few years ago I managed to decompile it btw, but now I can't get it back. I also managed to get it working by using the 1.4.5 Windows version via the .bat. Nah... It's very inconsistent. |
Your problem seems to be something related to external lump files. When you have files named @JarodSCP Your original issue however seems to be of some different cause. If you can still have the bsp, I would look at that as well. |
You're right! Indeed a problematic external lump was affecting the original bsp decompilation. The external lump was manually edited and had an excess size according to the header (178627, which becomes 178647 when including the 20 bytes from the header itself). The real size of the lump file is indeed 177872. I had forgotten to adjust the size in the lump header when I finished experimenting as, ingame, no error shows up. Here is the file btw: labirinferno_parte1_l_0.lmp.txt. But most importantly, I did not know a lump in the same directory as the target bsp would also take part in the decompilation. I thought I had to explicitly include it in the Files list. Well, now I know. But I would suggest that you make it so that mismatching lump sizes are treated as a warning and not error, i.e. rely on the real lump size. Furthermore, it would be nice to clarify that the 'Load lump files' option reads lumps with the same name and in the same directory/path. As I hinted, when I read "external" in the tooltip, I understood that the lump files could be in any directory as long as you included them in the Files list. ;) |
Yeah that's what I also took from this. Invalid lump sizes should not crash the program. We actually already have code to deal with these, but only for the lumps included in the bsp and not external ones. Should be easy to fix. |
Fixes checks of valid offset/size and also try to gracefully handle these cases by defaulting to sensible values. #150 (comment)
Fixes checks of valid offset/size and also try to gracefully handle these cases by defaulting to sensible values. Motivated by #150 (comment)
I have this error when I try to decompile this maps: https://steamcommunity.com/sharedfiles/filedetails/?id=2845503123
[error] BspSource: Decompiling error, caused by java.lang.IllegalArgumentException: newLimit < 0: (-2138374787 < 0)
at java.base/java.nio.Buffer.createLimitException(Buffer.java:395)
at java.base/java.nio.Buffer.limit(Buffer.java:369)
at java.base/java.nio.ByteBuffer.limit(ByteBuffer.java:1529)
at java.base/java.nio.MappedByteBuffer.limit(MappedByteBuffer.java:330)
at java.base/java.nio.MappedByteBuffer.limit(MappedByteBuffer.java:73)
at info.ata4.io.buffer.ByteBufferUtils.getSlice(ByteBufferUtils.java:255)
at info.ata4.bsplib.BspFile.loadLumps(BspFile.java:349)
at info.ata4.bsplib.BspFile.load(BspFile.java:160)
at info.ata4.bsplib.BspFile.load(BspFile.java:180)
at info.ata4.bspsrc.BspSource.decompile(BspSource.java:107)
at info.ata4.bspsrc.BspSource.run(BspSource.java:72)
at info.ata4.bspsrc.gui.BspSourceFrame$4.run(BspSourceFrame.java:359)
The text was updated successfully, but these errors were encountered: