src/io/source_sndfile.c: fix crash, zero-pad output vector when upsampling
authorPaul Brossier <piem@piem.org>
Mon, 7 Jul 2014 21:25:09 +0000 (18:25 -0300)
committerPaul Brossier <piem@piem.org>
Mon, 7 Jul 2014 21:25:09 +0000 (18:25 -0300)
src/io/source_sndfile.c

index e34df95..6cc54f7 100644 (file)
@@ -184,7 +184,7 @@ void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uin
 
   if (*read < s->hop_size) {
     for (j = *read; j < s->hop_size; j++) {
-      data[j] = 0;
+      read_data->data[j] = 0;
     }
   }
 
@@ -247,7 +247,7 @@ void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat
   if (*read < s->hop_size) {
     for (i = 0; i < read_data->height; i++) {
       for (j = *read; j < s->hop_size; j++) {
-        data[i][j] = 0.;
+        read_data->data[i][j] = 0.;
       }
     }
   }