pezmaster31/bamtools — pull request #40 by tobiasmarschall (2012-03-23 10:10:55+00:00)
Title: Fix uninitialized buffer in BamReaderPrivate::LoadNextAlignment

Normally, the variable "buffer" is filled by the call to m_stream.Read (BamReader_p.cpp:235). When the input file has ended (i.e. no more bytes are available), however, m_stream.Read does not write to the buffer. This ultimately results in alignment.SupportData.BlockLength being uninitialized and the outcome of the if-clause in line 238 being undefined.

Therefore, I've added a fill_n to inizialize the buffer.