Prevent endless read of silent files
This fixes issues with analysis and archiving that rely on a readable to return 0. Note however that createSilent() uses max_samplecnt (INT64_MAX) by default. This relies on a region setting the length of its missing source.
This commit is contained in:
@@ -51,7 +51,8 @@ protected:
|
||||
_length = len;
|
||||
}
|
||||
|
||||
samplecnt_t read_unlocked (Sample *dst, samplepos_t /*start*/, samplecnt_t cnt) const {
|
||||
samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const {
|
||||
cnt = std::min (cnt, _length - start);
|
||||
memset (dst, 0, sizeof (Sample) * cnt);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user