Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The SAM sam_dispatcher_read decodes blocks of SAM records into blocks of BAM records. As this is (hopefully) reading ahead of the sam_read1 consumer code, when it hits EOF it adds a final NULL block as a sentinel. This works well and it forces sam_read1 to return EOF too. However, if we ignore that and call sam_read1 again, it's consumed our sentinel block and it gets stuck waiting for the next block of BAM records. We now cache the EOF status and check first. Note this doesn't impact on iterators as they work at a different level already and it's the iterator itself which tracks EOF. Fixes #1855
- Loading branch information