From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 71F464A750 for ; Sun, 5 May 2024 22:31:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E05C68D58D; Mon, 6 May 2024 01:30:50 +0300 (EEST) Received: from flump.de (flump.de [185.163.118.210]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9561568D540 for ; Mon, 6 May 2024 01:30:42 +0300 (EEST) Received: from falbala.fritz.box (ip4d1692dd.dynamic.kabel-deutschland.de [77.22.146.221]) by flump.de (Postfix) with ESMTPSA id 954F1D6CBD3 for ; Mon, 6 May 2024 00:30:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flump.de; s=mail; t=1714948241; bh=aZyUAA5sBp6pznZnCZnTsQqW1NUFPIn5aZvJqsdq+iw=; h=From:To:Subject:Date; b=Yq+cNN8PqUtCY+wVXBf5y+eV0LQxK/oa2+bm3zytvAEAq94TPJb+FpZT3cHI1YJMX gPFoEyHz0HBRwV0TLDLpDSIidvHlQi//tdQdLQvXyn/2vcVu9BvAdz2md3kjLpU7o9 +DtEpcMPo5ngQEKWOA0anllMDsVa6iPTBpfkLeOw= From: Gerion Entrup To: ffmpeg-devel@ffmpeg.org Date: Mon, 6 May 2024 00:30:39 +0200 Message-ID: <20240505223040.521838-1-gerion.entrup@flump.de> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] libavfilter/signature_lookup: fix possible division by zero X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavfilter/signature_lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index a0ca818a9b..b39a3e225b 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -128,7 +128,7 @@ static int get_jaccarddist(SignatureContext *sc, CoarseSignature *first, CoarseS int jaccarddist, i, composdist = 0, cwthcount = 0; for (i = 0; i < 5; i++) { if ((jaccarddist = intersection_word(first->data[i], second->data[i])) > 0) { - jaccarddist /= union_word(first->data[i], second->data[i]); + jaccarddist /= FFMAX(union_word(first->data[i], second->data[i]), 1); } if (jaccarddist >= sc->thworddist) { if (++cwthcount > 2) { -- 2.43.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".