提交 79a54f30 编写于 作者: P Paul B Mahol

avfilter/af_sofalizer: fix crash when ir size is not aligned, usually when...

avfilter/af_sofalizer: fix crash when ir size is not aligned, usually when n_samples are not power of 2
Signed-off-by: NPaul B Mahol <onemda@gmail.com>
上级 2761e250
...@@ -490,8 +490,15 @@ static int compensate_volume(AVFilterContext *ctx) ...@@ -490,8 +490,15 @@ static int compensate_volume(AVFilterContext *ctx)
av_log(ctx, AV_LOG_DEBUG, "Compensate-factor: %f\n", compensate); av_log(ctx, AV_LOG_DEBUG, "Compensate-factor: %f\n", compensate);
ir = sofa->data_ir; ir = sofa->data_ir;
/* apply volume compensation to IRs */ /* apply volume compensation to IRs */
s->fdsp->vector_fmul_scalar(ir, ir, compensate, sofa->n_samples * sofa->m_dim * 2); if (sofa->n_samples & 31) {
emms_c(); 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; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册