Commit 870ff845 authored by Tristan Matthews's avatar Tristan Matthews Committed by Ralph Giles

wav_io: guard against invalid channel numbers

Fixes #13
parent a68d9349
Pipeline #2053 passed with stage
in 2 minutes and 32 seconds
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment