fix single-byte read when nothing has been read
Credit to OSS-Fuzz
@@ -58,7 +58,7 @@ public synchronized int read() throws IOException {
singleByteBuffer.rewind();
}
int read = read(loc, singleByteBuffer);
- if (read < 0) {
+ if (read < 1) {
return read;
}
loc++;
