1
0
Fork 0
forked from len0rd/rockbox

Fix peakmeter reading off the end of the buffer, thanks to petur

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8981 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2006-03-09 21:25:08 +00:00
parent 19f4c2a093
commit 7bc5bc4b49

View file

@ -774,9 +774,9 @@ void pcm_calculate_peaks(int *left, int *right)
#endif #endif
if (samples > PEAK_SAMPLES) if (samples > PEAK_SAMPLES)
samples = PEAK_SAMPLES - (PEAK_STRIDE - 1); samples = PEAK_SAMPLES - PEAK_STRIDE;
else else
samples -= MIN((PEAK_STRIDE - 1), samples); samples -= MIN(PEAK_STRIDE, samples);
end = addr + samples * 4; end = addr + samples * 4;
} }