diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-04-22 00:43:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-04-24 02:52:16 +0200 |
commit | 25cb66369e7b81bd280f0bdd6d51a0e2e11881e3 (patch) | |
tree | 90b573fa9fd93b629b73cf9913b2699f7ad34c5d | |
parent | fb4a1eaadfbf1c212716d4608d5ef2a1833b6c12 (diff) | |
download | ffmpeg-25cb66369e7b81bd280f0bdd6d51a0e2e11881e3.tar.gz |
avfilter/signature_lookup: Fix 2 differences to the refernce SW
Fixes: CID1403227 Division or modulo by float zero
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavfilter/signature_lookup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index ab7320d47f..a3086b38cc 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -496,10 +496,10 @@ static MatchingInfo evaluate_parameters(AVFilterContext *ctx, SignatureContext * continue; /* matching sequence is too short */ if ((double) goodfcount / (double) fcount < sc->thit) continue; - if ((double) goodfcount*0.5 < FFMAX(gooda, goodb)) + if ((double) goodfcount*0.5 <= FFMAX(gooda, goodb)) continue; - meandist = (double) goodfcount / (double) distsum; + meandist = (double) distsum / (double) goodfcount; if (meandist < minmeandist || status == (STATUS_END_REACHED | STATUS_BEGIN_REACHED) || |