[FFmpeg-devel] [PATCH 2/3] avfilter/signature_lookup: Initialize bestmatch

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Apr 22 02:10:47 EEST 2024


Michael Niedermayer:
> Fixes: CID1500345 Uninitialized scalar variable
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavfilter/signature_lookup.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c
> index a3086b38cca..dc0a2ef2b24 100644
> --- a/libavfilter/signature_lookup.c
> +++ b/libavfilter/signature_lookup.c
> @@ -535,16 +535,14 @@ static MatchingInfo lookup_signatures(AVFilterContext *ctx, SignatureContext *sc
>  {
>      CoarseSignature *cs, *cs2;
>      MatchingInfo *infos;
> -    MatchingInfo bestmatch;
> +    MatchingInfo bestmatch = {0};
>      MatchingInfo *i;
>  
>      cs = first->coarsesiglist;
>      cs2 = second->coarsesiglist;
>  
>      /* score of bestmatch is 0, if no match is found */
> -    bestmatch.score = 0;
>      bestmatch.meandist = 99999;
> -    bestmatch.whole = 0;
>  
>      fill_l1distlut(sc->l1distlut);
>  

Does this fix an actual bug or just suppress a Coverity warning?

- Andreas



More information about the ffmpeg-devel mailing list