From a0832282a87d370ec5383b036015b013277d9041 Mon Sep 17 00:00:00 2001 From: Brad Midgley Date: Wed, 30 Jan 2008 20:28:37 +0000 Subject: fix off-by-one in sbcdec --- sbc/sbcdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbc') 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); -- cgit