]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/BamStandardIndex_p.cpp
Bug discovered. The chunkStop was not being read from the correct offset (rather...
[bamtools.git] / src / api / internal / BamStandardIndex_p.cpp
index 8993d43175a2d93bc4b5fea65525808a41c42056..6d8273e9c1477a965aebb0bea553026014c90d4a 100644 (file)
@@ -125,7 +125,7 @@ bool BamStandardIndex::CalculateCandidateOffsets(const BaiReferenceSummary& refS
                 // read chunk start & stop from buffer
                 memcpy((char*)&chunkStart, m_buffer+offset, sizeof(uint64_t));
                 offset += sizeof(uint64_t);
-                memcpy((char*)&chunkStop, m_buffer, sizeof(uint64_t));
+                memcpy((char*)&chunkStop, m_buffer+offset, sizeof(uint64_t));
                 offset += sizeof(uint64_t);
 
                 // swap endian-ness if necessary