gst/audioconvert/gstchannelmix.c: Prevent division by zero if the channel mix matrix...
authorSebastian Dröge <slomo@circular-chaos.org>
Wed, 21 May 2008 07:28:04 +0000 (07:28 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Wed, 21 May 2008 07:28:04 +0000 (07:28 +0000)
Original commit message from CVS:
* gst/audioconvert/gstchannelmix.c:
(gst_channel_mix_fill_normalize):
Prevent division by zero if the channel mix matrix contains only
zeroes.

ChangeLog
gst/audioconvert/gstchannelmix.c

index 269412d..48b9aaa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-05-21  Sebastian Dröge  <slomo@circular-chaos.org>
 
+       * gst/audioconvert/gstchannelmix.c:
+       (gst_channel_mix_fill_normalize):
+       Prevent division by zero if the channel mix matrix contains only
+       zeroes.
+
+2008-05-21  Sebastian Dröge  <slomo@circular-chaos.org>
+
        Patch by: Antoine Tremblay <hexa00 at gmail dot com>
 
        * gst/gdp/gstgdppay.c: (gst_gdp_pay_chain):
index 98648db..063c496 100644 (file)
@@ -449,6 +449,9 @@ gst_channel_mix_fill_normalize (AudioConvertCtx * this)
   }
 
   /* normalize to this */
+  if (top == 0.0)
+    return;
+
   for (j = 0; j < this->out.channels; j++) {
     for (i = 0; i < this->in.channels; i++) {
       this->matrix[i][j] /= top;