diff options
author | Brad Midgley <bmidgley@xmission.com> | 2008-01-30 20:28:37 +0000 |
---|---|---|
committer | Brad Midgley <bmidgley@xmission.com> | 2008-01-30 20:28:37 +0000 |
commit | a0832282a87d370ec5383b036015b013277d9041 (patch) | |
tree | 1b1b6ba8648fc26be2526e72bac7e1a6ceed512c /sbc/sbcdec.c | |
parent | 6c4268df1dff13f3b1a7b778eb2e993648bff519 (diff) |
fix off-by-one in sbcdec
Diffstat (limited to 'sbc/sbcdec.c')
-rw-r--r-- | sbc/sbcdec.c | 4 |
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); |