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:
parent
19f4c2a093
commit
7bc5bc4b49
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue