Applied patch 1547642, fixing a bug where we try to access elements
in an empty std::list.
This commit is contained in:
parent
b728885e25
commit
de7d35026f
|
@ -37,6 +37,12 @@ CStreamBuffer::peek(UInt32 n)
|
||||||
{
|
{
|
||||||
assert(n <= m_size);
|
assert(n <= m_size);
|
||||||
|
|
||||||
|
// if requesting no data then return NULL so we don't try to access
|
||||||
|
// an empty list.
|
||||||
|
if (n == 0) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// reserve space in first chunk
|
// reserve space in first chunk
|
||||||
ChunkList::iterator head = m_chunks.begin();
|
ChunkList::iterator head = m_chunks.begin();
|
||||||
head->reserve(n + m_headUsed);
|
head->reserve(n + m_headUsed);
|
||||||
|
|
Loading…
Reference in New Issue