@@ -0,0 +1,28 @@
1+From ebb64cddde59ecc9cedf3741ce2337c72148cc0c Mon Sep 17 00:00:00 2001
2+From: Chris Bagwell <chris@cnpbagwell.com>
3+Date: Sat, 13 Dec 2014 12:49:55 -0600
4+Subject: [PATCH 2/2] More checks for invalid MS ADPCM blocks.
5+
6+If block doesn't exacty match blockAlign then do not allow
7+number of samples in invalid size block to ever be more than
8+what WAV header defined as samplesPerBlock.
9+---
10+ src/wav.c | 2 +-
11+ 1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+diff --git a/src/wav.c b/src/wav.c
14+index 61d5908..5202556 100644
15+--- a/src/wav.c
16++++ b/src/wav.c
17+@@ -168,7 +168,7 @@ static unsigned short AdpcmReadBlock(sox_format_t * ft)
18+ /* work with partial blocks. Specs say it should be null */
19+ /* padded but I guess this is better than trailing quiet. */
20+ samplesThisBlock = lsx_ms_adpcm_samples_in((size_t)0, (size_t)ft->signal.channels, bytesRead, (size_t)0);
21+- if (samplesThisBlock == 0)
22++ if (samplesThisBlock == 0 || samplesThisBlock > wav->samplesPerBlock)
23+ {
24+ lsx_warn("Premature EOF on .wav input file");
25+ return 0;
26+--
27+2.1.0
28+