Skip to content

Commit

Permalink
Fix reading zero-length CFFIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Jan 6, 2025
1 parent 2ff785e commit b2f69d3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected CFFIndex readIndex() throws IOException {
throw new IOException("Wrong index data offset");
}
byte[] data = new byte[offset[count] - 1];
if (source.read(data, data.length) != data.length) {
if (data.length != 0 && source.read(data, data.length) != data.length) {
throw new IOException("End of stream is reached");
}
int offsetShift = 3 + offSize * (count + 1);
Expand Down

0 comments on commit b2f69d3

Please sign in to comment.