[FFmpeg-devel] [PATCH 1/3] avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()

Anton Khirnov anton at khirnov.net
Sat Jun 5 16:44:49 EEST 2021


Quoting Michael Niedermayer (2021-06-01 09:33:13)
> Fixes: floating point division by 0
> Fixes: Ticket8213
> 
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/lpc.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
> index 52170fd623..c99e568794 100644
> --- a/libavcodec/lpc.h
> +++ b/libavcodec/lpc.h
> @@ -186,7 +186,8 @@ static inline int AAC_RENAME(compute_lpc_coefs)(const LPC_TYPE *autoc, int max_o
>              for(j=0; j<i; j++)
>                  r -= lpc_last[j] * autoc[i-j-1];
>  
> -            r /= err;
> +            if (r || err)

Why check for non-zero r?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list