diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2017-02-24 11:16:26 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2017-02-25 18:53:34 +0100 |
commit | 353f509ee34823d8567904236c729b308ed94578 (patch) | |
tree | e2ec152b1b37c59afbe682b5ba7f8e11d653107e /libswresample/rematrix.c | |
parent | d34bf886e963445350c4987f7a9ed77bd9c9a5c7 (diff) | |
download | ffmpeg-353f509ee34823d8567904236c729b308ed94578.tar.gz |
lswr/rematrix: Remove an aggressive loop optimization.
Fixes undefined behaviour and a gcc warning:
libswresample/rematrix.c:376:47: warning: iteration 64 invokes undefined behavior
Diffstat (limited to 'libswresample/rematrix.c')
-rw-r--r-- | libswresample/rematrix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 4721063a13..03b9b20900 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -371,9 +371,10 @@ av_cold static int auto_matrix(SwrContext *s) s->matrix[1] - s->matrix[0], s->matrix_encoding, s); if (ret >= 0 && s->int_sample_fmt == AV_SAMPLE_FMT_FLTP) { - int i; - for (i = 0; i < FF_ARRAY_ELEMS(s->matrix[0])*FF_ARRAY_ELEMS(s->matrix[0]); i++) - s->matrix_flt[0][i] = s->matrix[0][i]; + int i, j; + for (i = 0; i < FF_ARRAY_ELEMS(s->matrix[0]); i++) + for (j = 0; j < FF_ARRAY_ELEMS(s->matrix[0]); j++) + s->matrix_flt[i][j] = s->matrix[i][j]; } return ret; |