---
 src/wav.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/wav.c b/src/wav.c
index 71fd52acfc13..eca1cde51ee5 100644
--- a/src/wav.c
+++ b/src/wav.c
@@ -1379,6 +1379,12 @@ static int wavwritehdr(sox_format_t * ft, int 
second_header)
     long blocksWritten = 0;
     sox_bool isExtensible = sox_false;    /* WAVE_FORMAT_EXTENSIBLE? */
 
+    if (ft->signal.channels > UINT16_MAX) {
+        lsx_fail_errno(ft, SOX_EOF, "Too many channels (%u)",
+                       ft->signal.channels);
+        return SOX_EOF;
+    }
+
     dwSamplesPerSecond = ft->signal.rate;
     wChannels = ft->signal.channels;
     wBitsPerSample = ft->encoding.bits_per_sample;
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to