mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Fix a bug in pcmbuf.c when doing offset with modulus.
Causes the track change to go in the wrong buffer (and even be missed by playback) if the current descriptor for the write index is descriptor 0 because the offset used is "-1" upon track change. Got nailed by implicit conversion of the % operator dividend to unsigned. Change-Id: I32538db801ac9d790c8b1b5bd041b09ad4b64d2e
This commit is contained in:
parent
363f96b95b
commit
662f7576bf
1 changed files with 1 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ static struct chunkdesc * index_chunkdesc_offs(size_t index, int offset)
|
||||||
|
|
||||||
if (offset != 0)
|
if (offset != 0)
|
||||||
{
|
{
|
||||||
i = (i + offset) % pcmbuf_desc_count;
|
i = (i + offset) % (int)pcmbuf_desc_count;
|
||||||
|
|
||||||
/* remainder => modulus */
|
/* remainder => modulus */
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue