aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_resample_fallback.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm_resample_fallback.c')
-rw-r--r--src/pcm_resample_fallback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pcm_resample_fallback.c b/src/pcm_resample_fallback.c
index c5c4ae08c..59d095b66 100644
--- a/src/pcm_resample_fallback.c
+++ b/src/pcm_resample_fallback.c
@@ -20,6 +20,8 @@
#include "pcm_resample.h"
#include "gcc.h"
+#include <assert.h>
+
/* resampling code blatantly ripped from ESD */
size_t
pcm_resample_16(uint8_t channels,
@@ -33,6 +35,9 @@ pcm_resample_16(uint8_t channels,
unsigned dest_samples = dest_size / sizeof(*dest_buffer);
int16_t lsample, rsample;
+ assert((src_size % (sizeof(*src_buffer) * channels)) == 0);
+ assert((dest_size % (sizeof(*dest_buffer) * channels)) == 0);
+
switch (channels) {
case 1:
while (dest_pos < dest_samples) {