mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avfilter/af_sofalizer: fix crash when ir size is not aligned, usually when n_samples are not power of 2
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
2761e250cc
commit
79a54f30c8
@ -490,9 +490,16 @@ static int compensate_volume(AVFilterContext *ctx)
|
||||
av_log(ctx, AV_LOG_DEBUG, "Compensate-factor: %f\n", compensate);
|
||||
ir = sofa->data_ir;
|
||||
/* apply volume compensation to IRs */
|
||||
if (sofa->n_samples & 31) {
|
||||
int i;
|
||||
for (i = 0; i < sofa->n_samples * sofa->m_dim * 2; i++) {
|
||||
ir[i] = ir[i] * compensate;
|
||||
}
|
||||
} else {
|
||||
s->fdsp->vector_fmul_scalar(ir, ir, compensate, sofa->n_samples * sofa->m_dim * 2);
|
||||
emms_c();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user