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.
This commit is contained in:
Sebastian Dröge 2008-05-21 07:28:04 +00:00
parent a8dda35c1b
commit d47bd6d7bc
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,10 @@
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> 2008-05-21 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Antoine Tremblay <hexa00 at gmail dot com> Patch by: Antoine Tremblay <hexa00 at gmail dot com>

View file

@ -449,6 +449,9 @@ gst_channel_mix_fill_normalize (AudioConvertCtx * this)
} }
/* normalize to this */ /* normalize to this */
if (top == 0.0)
return;
for (j = 0; j < this->out.channels; j++) { for (j = 0; j < this->out.channels; j++) {
for (i = 0; i < this->in.channels; i++) { for (i = 0; i < this->in.channels; i++) {
this->matrix[i][j] /= top; this->matrix[i][j] /= top;