summaryrefslogtreecommitdiffstats
path: root/sbc/sbcdec.c
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2008-01-30 20:28:37 +0000
committerBrad Midgley <bmidgley@xmission.com>2008-01-30 20:28:37 +0000
commita0832282a87d370ec5383b036015b013277d9041 (patch)
tree1b1b6ba8648fc26be2526e72bac7e1a6ceed512c /sbc/sbcdec.c
parent6c4268df1dff13f3b1a7b778eb2e993648bff519 (diff)
fix off-by-one in sbcdec
Diffstat (limited to 'sbc/sbcdec.c')
-rw-r--r--sbc/sbcdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbc/sbcdec.c b/sbc/sbcdec.c
index 09a211a1..2fa3cbb9 100644
--- a/sbc/sbcdec.c
+++ b/sbc/sbcdec.c
@@ -125,7 +125,7 @@ static void decode(char *filename, char *output, int tofile)
* length of the frame we just decoded count is the number of
* decoded bytes yet to be written */
- if (count + len > BUF_SIZE) {
+ if (count + len >= BUF_SIZE) {
/* buffer is too full to stuff decoded audio in so it
* must be written to the device */
written = write(ad, buf, count);
@@ -134,7 +134,7 @@ static void decode(char *filename, char *output, int tofile)
}
/* sanity check */
- if (count + len > BUF_SIZE) {
+ if (count + len >= BUF_SIZE) {
fprintf(stderr,
"buffer size of %d is too small for decoded"
" data (%d)\n", BUF_SIZE, len + count);