diff --git a/src/main/java/au/com/southsky/jfreesane/SaneSession.java b/src/main/java/au/com/southsky/jfreesane/SaneSession.java
index <HASH>..<HASH> 100644
--- a/src/main/java/au/com/southsky/jfreesane/SaneSession.java
+++ b/src/main/java/au/com/southsky/jfreesane/SaneSession.java
@@ -435,7 +435,7 @@ public class SaneSession implements Closeable {
 

       int offset = 0;

       int bytesRead = 0;

-      while ((bytesRead = readRecord(bigArray, offset)) > 0) {

+      while ((bytesRead = readRecord(bigArray, offset)) >= 0) {

         offset += bytesRead;

       }
Empty records are perfectly valid, they do not signify an end of stream. JFreeSane incorrectly thought they signified an end of stream.