diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2008-12-04 20:36:41 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2008-12-04 20:36:41 +0000 |
commit | fb11a838eb33a9647a9609447762c9b5a8b1a832 (patch) | |
tree | 372bf8dbadf43faf42fd9e6eec57dafb77c9866a /apps/playback.c | |
parent | 45711ac2869f955c40be96d8dcbc7201c718dba4 (diff) | |
download | rockbox-fb11a838eb33a9647a9609447762c9b5a8b1a832.tar.gz rockbox-fb11a838eb33a9647a9609447762c9b5a8b1a832.zip |
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
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/playback.c b/apps/playback.c index de12916b66..b21a3c1d46 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -2323,7 +2323,13 @@ static void audio_reset_buffer(void) | |||
2323 | filebuflen &= ~15; | 2323 | filebuflen &= ~15; |
2324 | 2324 | ||
2325 | /* Subtract whatever the pcm buffer says it used plus the guard buffer */ | 2325 | /* Subtract whatever the pcm buffer says it used plus the guard buffer */ |
2326 | filebuflen -= pcmbuf_init(filebuf + filebuflen) + GUARD_BUFSIZE; | 2326 | const size_t pcmbuf_size = pcmbuf_init(filebuf + filebuflen) +GUARD_BUFSIZE; |
2327 | #ifdef DEBUG | ||
2328 | if(pcmbuf_size > filebuflen) | ||
2329 | panicf("Not enough memory for pcmbuf_init() : %d > %d", | ||
2330 | (int)pcmbuf_size, (int)filebuflen); | ||
2331 | #endif | ||
2332 | filebuflen -= pcmbuf_size; | ||
2327 | 2333 | ||
2328 | /* Make sure filebuflen is a longword multiple after adjustment - filebuf | 2334 | /* Make sure filebuflen is a longword multiple after adjustment - filebuf |
2329 | will already be line aligned */ | 2335 | will already be line aligned */ |