libswresample: move condition to start of loop.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 6 Sep 2014 19:22:36 +0000 (21:22 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 7 Sep 2014 09:31:34 +0000 (11:31 +0200)
commit2c5c37ade115b5efa3f77ce11bc2c4e46b384959
tree2d374a9075ffb00842df8d2ad33f5d7c6cc9e2ed
parent284123d7fd8e78a7daa948b662e65eda3b33fce2
libswresample: move condition to start of loop.

This avoids several issue like calculating sum/maxcoef
incorrectly due to adding up matrix entries that will
be overwritten, as well as out-of-range writes to
s->matrix if the maximum allowed number of channels is used.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libswresample/rematrix.c