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

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
388 dst[2 * n ] = mag * cosf(ph); \388 dst[2 * n ] = mag * cosf(ph); \
389 dst[2 * n + 1] = mag * sinf(ph);389 dst[2 * n + 1] = mag * sinf(ph);
390 390
391
392static void calculate_factors(AVFilterContext *ctx, int ch, int chan)391static void calculate_factors(AVFilterContext *ctx, int ch, int chan)
393{392{
394 AudioSurroundContext *s = ctx->priv;393 AudioSurroundContext *s = ctx->priv;
395 float *factor = (float *)s->factors->extended_data[ch];394 float *factor = (float *)s->factors->extended_data[ch];
396 const float f_x = s->f_x[sc_map[chan]];395 const float f_x = s->f_x[sc_map[chan >= 0 ? chan : 0]];
397 const float f_y = s->f_y[sc_map[chan]];396 const float f_y = s->f_y[sc_map[chan >= 0 ? chan : 0]];
398 const int rdft_size = s->rdft_size;397 const int rdft_size = s->rdft_size;
399 const float *x = s->x_pos;398 const float *x = s->x_pos;
400 const float *y = s->y_pos;399 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