If the source stream went empty when we tried to refil then we failed to notice the EOF and read beyond the end of the buffer