# HG changeset patch # User Chris Cannam # Date 1479897310 0 # Node ID 56c06dc0937c8d36f15d5e6485db55ac85d1abef # Parent 6463046bd21d907a740d9602f3fcf95b8a90061d Avoid potentially trying to allocate negative-sized vector! diff -r 6463046bd21d -r 56c06dc0937c data/fileio/CodedAudioFileReader.cpp --- a/data/fileio/CodedAudioFileReader.cpp Wed Nov 23 10:34:45 2016 +0000 +++ b/data/fileio/CodedAudioFileReader.cpp Wed Nov 23 10:35:10 2016 +0000 @@ -480,9 +480,11 @@ // really have threads taking a long time to read concurrently m_dataLock.lock(); sv_frame_t n = sv_frame_t(m_data.size()); + if (ix0 > n) ix0 = n; if (ix1 > n) ix1 = n; frames = vector(m_data.begin() + ix0, m_data.begin() + ix1); m_dataLock.unlock(); + break; } }