[FFmpeg-devel] [PATCH 2/2] avcodec/avdct: Clear IDCTDSPContext context

James Almer jamrial at gmail.com
Mon Jan 27 23:09:28 EET 2020


On 1/27/2020 5:54 PM, Michael Niedermayer wrote:
> Fixes use of uninitialized variable and segfault
> 
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/avdct.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
> index 47e5f7134e..7c761cf39a 100644
> --- a/libavcodec/avdct.c
> +++ b/libavcodec/avdct.c
> @@ -100,7 +100,7 @@ int avcodec_dct_init(AVDCT *dsp)
>  
>  #if CONFIG_IDCTDSP
>      {
> -        IDCTDSPContext idsp;
> +        IDCTDSPContext idsp = {0};

Should probably be a memset() in ff_idctdsp_init(). This is not the only
IDCTDSPContext user.

>          ff_idctdsp_init(&idsp, avctx);
>          COPY(idsp, idct);
>          COPY(idsp, idct_permutation);
> 



More information about the ffmpeg-devel mailing list