diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-06 21:34:10 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-06 21:34:10 +0200 |
commit | 00312e6e3a3f6ed3fc52e4f4491d6d84242bed57 (patch) | |
tree | abffdb3343c5dc502a0ca44931529f2e16e35790 | |
parent | 72faae5d47bf49b7e3aa5bde43bf519382a5efc8 (diff) |
fixed bug in flac decoder attempting to play past end of file
-rw-r--r-- | plugins/flac/flac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index a2e8506a..ced92d45 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -196,12 +196,13 @@ cflac_init (DB_playItem_t *it) { plugin.free (); return -1; } + trace ("flac(cue): startsample=%d, endsample=%d, totalsamples=%d, currentsample=%d\n", startsample, endsample, flac_callbacks.totalsamples, currentsample); } else { startsample = 0; endsample = flac_callbacks.totalsamples-1; currentsample = 0; - trace ("startsample=%d, endsample=%d, totalsamples=%d\n", startsample, endsample, flac_callbacks.totalsamples); + trace ("flac: startsample=%d, endsample=%d, totalsamples=%d\n", startsample, endsample, flac_callbacks.totalsamples); } remaining = 0; @@ -261,7 +262,7 @@ cflac_read_int16 (char *bytes, int size) { static int cflac_read_float32 (char *bytes, int size) { - int initsize = size; +// trace ("currentsample=%d\n", currentsample); if (size / (4 * plugin.info.channels) + currentsample > endsample) { size = (endsample - currentsample + 1) * 4 * plugin.info.channels; trace ("size truncated to %d bytes, cursample=%d, endsample=%d\n", size, currentsample, endsample); @@ -269,6 +270,7 @@ cflac_read_float32 (char *bytes, int size) { return 0; } } + int initsize = size; do { if (remaining) { int sz = min (remaining, size); |