From: Paul Davis Date: Mon, 26 Oct 2009 01:04:40 +0000 (+0000) Subject: fix for peak data reading (carl h, #2388) X-Git-Tag: 2.8.16~688 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=095d2bd5b287362b3faf0026b479227236399be1;p=ardour.git fix for peak data reading (carl h, #2388) git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5920 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 36a667d109..3d6e804a60 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -374,7 +374,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t s } if (zero_fill) { - memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill); + memset (peaks + npeaks - zero_fill, 0, sizeof (PeakData) * zero_fill); } return 0; @@ -485,7 +485,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t s } if (zero_fill) { - memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill); + memset (peaks + npeaks - zero_fill, 0, sizeof (PeakData) * zero_fill); } ret = 0; @@ -562,7 +562,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t s } if (zero_fill) { - memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill); + memset (peaks + npeaks - zero_fill, 0, sizeof (PeakData) * zero_fill); } ret = 0;