[FFmpeg-devel] [PATCH 04/25] avfilter/af_headphone: Fix segfault when using very short streams
Paul B Mahol
onemda at gmail.com
Wed Sep 9 03:48:11 EEST 2020
On Tue, Sep 08, 2020 at 11:18:35PM +0200, Andreas Rheinhardt wrote:
> When the headphone filter does its processing in the time domain,
> the lengths of the buffers involved are determined by three parameters,
> only two of which are relevant here: ir_len and air_len. The former is
> the length (in samples) of the longest HRIR input stream and the latter
> is the smallest power-of-two bigger than ir_len.
>
> Using optimized functions to calculate the convolution places
> restrictions on the alignment of the length of the vectors whose scalar
> product is calculated. Therefore said length, namely ir_len, is aligned
> on 32; but the number of elements of the buffers used is given by air_len
> and for ir_len < 16 a buffer overflow happens.
>
> This commit fixes this by ensuring that air_len is always >= 32 if
> processing happens in the time domain.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
> libavfilter/af_headphone.c | 3 +++
> 1 file changed, 3 insertions(+)
>
LGTM
More information about the ffmpeg-devel
mailing list