diff options
author | Robin Gareus <robin@gareus.org> | 2018-01-26 13:56:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-01-26 18:07:23 +0100 |
commit | 48c1a2428414761d5f461d8fa2cbbc7b1143deca (patch) | |
tree | 44a86512102f01c73a4b427297f63b8cbf07ac23 /libs/ardour/audiosource.cc | |
parent | 76b7345ab6f3ccaf9e916c6f5d30358b44ff67ea (diff) |
Fix some clang warnings (argument with 'nonnull' attribute passed null)
Diffstat (limited to 'libs/ardour/audiosource.cc')
-rw-r--r-- | libs/ardour/audiosource.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index aea0203394..559a9c616d 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -926,7 +926,9 @@ AudioSource::compute_and_write_peaks (Sample* buf, samplecnt_t first_sample, sam memcpy (buf2.get(), peak_leftovers, peak_leftover_cnt * sizeof (Sample)); /* the new stuff */ - memcpy (buf2.get()+peak_leftover_cnt, buf, cnt * sizeof (Sample)); + if (buf && cnt > 0) { + memcpy (buf2.get()+peak_leftover_cnt, buf, cnt * sizeof (Sample)); + } /* no more leftovers */ peak_leftover_cnt = 0; |