music_pipe: narrowed assertion on chunk index

The chunk index passed to successor() must be valid, i.e. it must be
smaller than num_chunks.
This commit is contained in:
Max Kellermann 2008-11-18 19:54:39 +01:00
parent 7591403566
commit 63272d6888

View File

@ -67,7 +67,7 @@ void music_pipe_free(void)
/** return the index of the chunk after i */
static inline unsigned successor(unsigned i)
{
assert(i <= music_pipe.num_chunks);
assert(i < music_pipe.num_chunks);
++i;
return i == music_pipe.num_chunks ? 0 : i;