gst/filter/gstbpwsinc.c: Fix a segfault with more than one channel and don't rebuild...
authorSebastian Dröge <slomo@circular-chaos.org>
Fri, 10 Aug 2007 05:51:40 +0000 (05:51 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Fri, 10 Aug 2007 05:51:40 +0000 (05:51 +0000)
Original commit message from CVS:
* gst/filter/gstbpwsinc.c: (bpwsinc_build_kernel):
Fix a segfault with more than one channel and don't rebuild
the kernel & residue with every buffer.

ChangeLog
gst/filter/gstbpwsinc.c

index 443b77ff79d585e1e1c3e32e0190a5c920565ea3..c5db4dd04a42a0fe8ad476253ee9b306b845d4ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-10  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * gst/filter/gstbpwsinc.c: (bpwsinc_build_kernel):
+       Fix a segfault with more than one channel and don't rebuild
+       the kernel & residue with every buffer.
+
 2007-08-10  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * gst/filter/gstbpwsinc.c: (gst_bpwsinc_mode_get_type),
index dcf7c68f14b2301c8c6f8cd02045e7ff79076cbe..d6bb3d12d69839aaa0bff93786b6297b99733fd8 100644 (file)
@@ -313,6 +313,8 @@ bpwsinc_build_kernel (GstBPWSinc * self)
     return;
   }
 
+  self->have_kernel = TRUE;
+
   /* Clamp frequencies */
   self->lower_frequency =
       CLAMP (self->lower_frequency, 0.0,
@@ -412,7 +414,8 @@ bpwsinc_build_kernel (GstBPWSinc * self)
   if (self->residue)
     g_free (self->residue);
 
-  self->residue = g_new0 (gdouble, len);
+  self->residue =
+      g_new0 (gdouble, len * GST_AUDIO_FILTER (self)->format.channels);
 }
 
 /* GstAudioFilter vmethod implementations */