Blame SOURCES/libsndfile-1.0.31-deb669ee.patch
|
|
9178b9 |
diff --git a/src/ms_adpcm.c b/src/ms_adpcm.c
|
|
|
9178b9 |
index 5e8f1a31..a21cb994 100644
|
|
|
9178b9 |
--- a/src/ms_adpcm.c
|
|
|
9178b9 |
+++ b/src/ms_adpcm.c
|
|
|
9178b9 |
@@ -128,8 +128,14 @@ wavlike_msadpcm_init (SF_PRIVATE *psf, int blockalign, int samplesperblock)
|
|
|
9178b9 |
if (psf->file.mode == SFM_WRITE)
|
|
|
9178b9 |
samplesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ;
|
|
|
9178b9 |
|
|
|
9178b9 |
- if (blockalign < 7 * psf->sf.channels)
|
|
|
9178b9 |
- { psf_log_printf (psf, "*** Error blockalign (%d) should be > %d.\n", blockalign, 7 * psf->sf.channels) ;
|
|
|
9178b9 |
+ /* There's 7 samples per channel in the preamble of each block */
|
|
|
9178b9 |
+ if (samplesperblock < 7 * psf->sf.channels)
|
|
|
9178b9 |
+ { psf_log_printf (psf, "*** Error samplesperblock (%d) should be >= %d.\n", samplesperblock, 7 * psf->sf.channels) ;
|
|
|
9178b9 |
+ return SFE_INTERNAL ;
|
|
|
9178b9 |
+ } ;
|
|
|
9178b9 |
+
|
|
|
9178b9 |
+ if (2 * blockalign < samplesperblock * psf->sf.channels)
|
|
|
9178b9 |
+ { psf_log_printf (psf, "*** Error blockalign (%d) should be >= %d.\n", blockalign, samplesperblock * psf->sf.channels / 2) ;
|
|
|
9178b9 |
return SFE_INTERNAL ;
|
|
|
9178b9 |
} ;
|
|
|
9178b9 |
|