Skip to content

Commit 4e278f1

Browse files
committed
Fix reading zero bytes from EexecFilterDecode
1 parent 63186d8 commit 4e278f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/verapdf/pd/font/type1/EexecFilterDecode.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ public EexecFilterDecode(ASInputStream stream, boolean isCharstring) throws IOEx
8686
public int read(byte[] buffer, int size) throws IOException {
8787
int bytesRead = this.feedBuffer(bytesToDiscard + size);
8888
int res = bytesRead - bytesToDiscard;
89-
if (bytesRead <= 0) {
89+
if (bytesRead < 0) {
90+
return -1;
91+
}
92+
else if (size == 0) {
93+
return 0;
94+
}
95+
else if (bytesRead == 0) {
9096
return -1;
9197
}
9298
for (int i = 0; i < bytesRead; ++i) {

0 commit comments

Comments
 (0)