diff options
author | Tristan Matthews <tmatth@videolan.org> | 2020-07-14 06:25:03 +0300 |
---|---|---|
committer | Ralph Giles <giles@thaumas.net> | 2020-07-16 22:03:19 +0300 |
commit | 870ff845b32f314aec0036641ffe18aba4916887 (patch) | |
tree | 9c722bae7f1ba3af2f1d6b26caf5863ec576b26b | |
parent | a68d9349a605f62dae81f8fb81c0e10254aa222e (diff) |
wav_io: guard against invalid channel numbers
Fixes #13
-rw-r--r-- | src/wav_io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wav_io.c b/src/wav_io.c index b518301..09d62eb 100644 --- a/src/wav_io.c +++ b/src/wav_io.c @@ -111,7 +111,7 @@ int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32 stmp = le_short(stmp); *channels = stmp; - if (stmp>2) + if (stmp>2 || stmp<1) { fprintf (stderr, "Only mono and (intensity) stereo supported\n"); return -1; |