Closed MarcoBerlot closed 3 years ago
Thanks for reporting this. What version of lz4-java are you using?
Java version: 10.0.1 (build 10.0.1+10) x 86_64
openjdk 11.0.9 2020-10-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9+11-LTS, mixed mode, sharing)
Thanks @odaira
One way that I was able to reproduce this is by passing an empty file. In this case nextFrameInfo();
will return early and ByteBuffer buffer
won't be initialized and when it tries to read the file it will encounter a NPE.
I believe a more explicit exception might help in this case, or make sure that the buffer gets initialized also in the case of an empty file.
@MarcoBerlot These are the versions of your Java runtime, but I would like to know the version of lz4-java you are using.
Java version: 10.0.1 (build 10.0.1+10) x 86_64 openjdk 11.0.9 2020-10-20 LTS OpenJDK Runtime Environment 18.9 (build 11.0.9+11-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.9+11-LTS, mixed mode, sharing)
Doesn't your application include a jar file named lz4-java-x.y.z.jar, like lz4-java-1.7.1.jar? Then x.y.z is the version of lz4-java.
@odaira sorry, I did not read it correctly. I'm using version 1.4
Fixed by 5e2357339ff4b0dc7eb0e5a21a500d0ca5508594 and fa30b170ad3942bc116f1e1e2dc56d8287baf0c7. Thank you for your help!
Describe the bug Null pointer exception being thrown while attempting to read lz4 file.
Expected behavior The file should be properly uncompressed and read.
To Reproduce Unfortunately I can't provide steps to reproduce since this has happened in our production environment. Here's the function that is reading the lz4 files
System (please complete the following information):