summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-12-12 15:15:35 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-12-12 15:15:35 +0000
commit609927164fbb7aabebf25f8edf1ee76ec657b8fa (patch)
tree2aa69f3e1fa962d29d1e3f5e720593b5262d9bd7 /usr.bin
parent9dfe6e27554c4e9ba33949827433f475758d59f1 (diff)
when parsing .wav headers, check if rate <= RATE_MAX (instead of
rate < RATE_MAX). Similarly check if bits <= 32 (instead of bits < 32)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/aucat/headers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/aucat/headers.c b/usr.bin/aucat/headers.c
index 53e550b182c..20f68d01436 100644
--- a/usr.bin/aucat/headers.c
+++ b/usr.bin/aucat/headers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: headers.c,v 1.8 2009/09/27 11:51:20 ratchov Exp $ */
+/* $OpenBSD: headers.c,v 1.9 2009/12/12 15:15:34 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -98,12 +98,12 @@ wav_readfmt(int fd, unsigned csize, struct aparams *par, short **map)
return 0;
}
rate = letoh32(fmt.rate);
- if (rate < RATE_MIN || rate >= RATE_MAX) {
+ if (rate < RATE_MIN || rate > RATE_MAX) {
warnx("%u: bad sample rate", rate);
return 0;
}
bits = letoh16(fmt.bits);
- if (bits == 0 || bits >= 32) {
+ if (bits == 0 || bits > 32) {
warnx("%u: bad number of bits", bits);
return 0;
}