From d47bd6d7bcb028453810b6dd68137ae6050ce64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2008 07:28:04 +0000 Subject: [PATCH] gst/audioconvert/gstchannelmix.c: Prevent division by zero if the channel mix matrix contains only zeroes. 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 | 7 +++++++ gst/audioconvert/gstchannelmix.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 269412db87..48b9aaa4b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-21 Sebastian Dröge + + * 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 Patch by: Antoine Tremblay diff --git a/gst/audioconvert/gstchannelmix.c b/gst/audioconvert/gstchannelmix.c index 98648db869..063c496dad 100644 --- a/gst/audioconvert/gstchannelmix.c +++ b/gst/audioconvert/gstchannelmix.c @@ -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;