History

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

Carl Eugen Hoyos committed 9 years ago

Commit 353f5091 parent d34bf881 file · +4 −3Browse files

Unified · Split

libswresample/rematrix.c+4−3
@@ -371,9 +371,10 @@ av_cold static int auto_matrix(SwrContext *s) · 370 unmodified lines
371 s->matrix[1] - s->matrix[0], s->matrix_encoding, s);371 s->matrix[1] - s->matrix[0], s->matrix_encoding, s);
372 372
373 if (ret >= 0 && s->int_sample_fmt == AV_SAMPLE_FMT_FLTP) {373 if (ret >= 0 && s->int_sample_fmt == AV_SAMPLE_FMT_FLTP) {
374 int i;374 int i, j;
375 for (i = 0; i < FF_ARRAY_ELEMS(s->matrix[0])*FF_ARRAY_ELEMS(s->matrix[0]); i++)375 for (i = 0; i < FF_ARRAY_ELEMS(s->matrix[0]); i++)
376 s->matrix_flt[0][i] = s->matrix[0][i];376 for (j = 0; j < FF_ARRAY_ELEMS(s->matrix[0]); j++)
377 s->matrix_flt[i][j] = s->matrix[i][j];
377 }378 }
378 379
379 return ret;380 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t