Commit 353f509e authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

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
parent d34bf886
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment