changeset 1282:56c06dc0937c 3.0-integration

Avoid potentially trying to allocate negative-sized vector!
author Chris Cannam
date Wed, 23 Nov 2016 10:35:10 +0000
parents 6463046bd21d
children 2f468f43c02c
files data/fileio/CodedAudioFileReader.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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<float>(m_data.begin() + ix0, m_data.begin() + ix1);
         m_dataLock.unlock();
+        break;
     }
     }