1
0
Fork 0
forked from len0rd/rockbox

playback: sanity check for pcmbuf_init() requirement (enabled in DEBUG)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19331 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2008-12-04 20:36:41 +00:00
parent 45711ac286
commit fb11a838eb

View file

@ -2323,7 +2323,13 @@ static void audio_reset_buffer(void)
filebuflen &= ~15; filebuflen &= ~15;
/* Subtract whatever the pcm buffer says it used plus the guard buffer */ /* Subtract whatever the pcm buffer says it used plus the guard buffer */
filebuflen -= pcmbuf_init(filebuf + filebuflen) + GUARD_BUFSIZE; const size_t pcmbuf_size = pcmbuf_init(filebuf + filebuflen) +GUARD_BUFSIZE;
#ifdef DEBUG
if(pcmbuf_size > filebuflen)
panicf("Not enough memory for pcmbuf_init() : %d > %d",
(int)pcmbuf_size, (int)filebuflen);
#endif
filebuflen -= pcmbuf_size;
/* Make sure filebuflen is a longword multiple after adjustment - filebuf /* Make sure filebuflen is a longword multiple after adjustment - filebuf
will already be line aligned */ will already be line aligned */