History

avfilter/af_surround: fix possible out of array access

Paul B Mahol committed 3 years ago

Commit 34eeb461 parent 7f3e38b1 file · +2 −3Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_surround.c+2−3
@@ -388,13 +388,12 @@ static inline void get_lfe(int output_lfe, int n, float lowcut, float highcut, · 387 unmodified lines
388388 dst[2 * n ] = mag * cosf(ph); \
389389 dst[2 * n + 1] = mag * sinf(ph);
390390
391−
392391 static void calculate_factors(AVFilterContext *ctx, int ch, int chan)
393392 {
394393 AudioSurroundContext *s = ctx->priv;
395394 float *factor = (float *)s->factors->extended_data[ch];
396− const float f_x = s->f_x[sc_map[chan]];
397− const float f_y = s->f_y[sc_map[chan]];
395+ const float f_x = s->f_x[sc_map[chan >= 0 ? chan : 0]];
396+ const float f_y = s->f_y[sc_map[chan >= 0 ? chan : 0]];
398397 const int rdft_size = s->rdft_size;
399398 const float *x = s->x_pos;
400399 const float *y = s->y_pos;

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