From patchwork Wed Feb 14 12:03:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46260 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c493:b0:19e:cdac:8cce with SMTP id eo19csp329502pzb; Wed, 14 Feb 2024 04:02:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxSW/zzjHkBqDc+k0YIaKAxaVXmQAkUn+YD6W7OCM6yg94T+9FLeOAY/OpgPwzUQYE+BFf6HF/Ax+OKEFWYy4p9dgkSvl28WNO/g== X-Google-Smtp-Source: AGHT+IFUV1oxLys2E5dZ/IEfm0N3oRMTJ2cmvcILwXvoTgnyY9n4PQAnGHJK1KJl9e5aDp0ccZFS X-Received: by 2002:ac2:430a:0:b0:511:ad0b:4982 with SMTP id l10-20020ac2430a000000b00511ad0b4982mr458722lfh.60.1707912143004; Wed, 14 Feb 2024 04:02:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXR7kT5nak5T+s5KWF8l6fweBXjSEVriEzuO8/gOorluhzcrVd3Pgd3yVrPA4SzgdbyLOwuoXAEChoZgtqkgCM1MSy9JSeunxT2+4QsgLc+PkV3JoPmSr7FSxQhR/sOzb4yaVsJ2yQJdhJ2sFtOcslKR+9GsdH5zRlAVkNCAyQEbVJENK+UgazZLTvOp5XxrzYFjYhlVcDBZywEjB7d0TEvvPRs3XwWPMXngbjJEtfN3nfvzeztJisiwPI1ZqWZPAAwsD1cxPsfV2I4CP3f0PVBiA4rcgD4YguGXhYO7S4bc+KR9VwUN8KiEEpeLlgpwop+m4l/c53TR1gc4lbeCDskG6HEab88DMNao1wBZfpJKaFT9Mv/t8pOVu1aOv5B2S0iSs/4k6Z7n81BwAaF4Jbn/1NV/jmOx0PXa8mz5uK6WX7zYZSnVyFRIHzeo4wgvWQiGptOA2w9/gFLuWfcd1DwwEDBAM2Wz8tm4D74TO20W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Xj0fw== Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l15-20020a1709066b8f00b00a3d1cdf9d76si1140431ejr.571.2024.02.14.04.02.21; Wed, 14 Feb 2024 04:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=kRgD02sM; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8874568D194; Wed, 14 Feb 2024 14:02:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2097.outbound.protection.outlook.com [40.92.59.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C54F268CC25 for ; Wed, 14 Feb 2024 14:02:11 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fy/QQ6ciSYJjBEA3LfH0gbg0EoTyNkHeu5bjdPF/fSFTG+KCCfB3UTfAuFH/onQzNgLn2B70rRc0hl57LN03wvSMMSlWuGBqEgZ/EkBNlTqVDmWvk8eumVw7W88LhRW1YblV5dy4AvB9JuSNmpsh337G8JJADmtGDMYVgssR57aEEx0Q9cpxUwu2mL6NFrgRTqXwvaMkgyzbzzRcgsh0kZkxIf2P7BRb2uYgSzQGJ+Koyy/9PjaTYpQWODZ0i8ac8m6c4Myo+nw1xXhRT7uPCHfIlh+3Z+3Ig4ZoAyp+XE59gd4K4Hd+HX9ekDZJ2hM77SjP7WDq5+r3tnSku6JOOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BwnYQmHtvekEmsJWPYkLVTBMwOVsz4IUz39BhgITi38=; b=FmFSTV2vcIKKmich36UpJ0uVf+vY/FsXkrSGJgWzz7fN3+frvsy6adg7nDLwmDk8njguKbJd1ZrDHinRkXfB39ve2mRMqSpl7WjCu9Fim0A+RrDZALNRHDKh8I5FCX1QsdWu/DR/6ucPyvs+Q3a5QqhRh7Evmb0dH8E6RJmu0BaIbfohu/UOinstXi3KekFhg7dxVa3+8X7n8uuXVxA6qaBC3NEENnVwDeNAhkspNmt3YOswUpzNBYmDFFXNIoO34c9/ur1+54k/Dzhbk4/tNiT8VFi+ZbRchO6478o4gIsgorCK5dBY1NgsNbcinJwJQH8PGBE92/kTj+1/mZhxvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BwnYQmHtvekEmsJWPYkLVTBMwOVsz4IUz39BhgITi38=; b=kRgD02sMIrGzrgtm0+fb+kM4J/mzKSNlsHwx942QfzuuOE9o62kqM6/vcYdUKgCZafTmxpM5kRxL3DDvA8hZgek9Lnm1eS14RhA9lkfNoY9n+ItHJorg0fDnWDzi2AhPKR8wm99IzNQn3jIllyeesXdoTE41ioxkAgqP8fFBFY35grFciRUGMK2c+y3K3sYQny4PaS4uH0SqRGGq3tSIP4ZSwQpvK5kQ4OfpOKH18uhk08lBHdg7IutekgiuGMqnIY6r5XyVTo2PfElZz2xFwb/wOHXH7cS3L79pWMjfCtejexGnTkQn81Py6o4UmI6i/Ack4E9pr7GzYQMtaphyxw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0157.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:320::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26; Wed, 14 Feb 2024 12:02:09 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 12:02:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 13:03:52 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [2M0fR2G6dOyVdIxsR5pMIjzndLwONyqrlR2gbh3Z9Xk=] X-ClientProxiedBy: FR0P281CA0197.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ad::20) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214120356.587377-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0157:EE_ X-MS-Office365-Filtering-Correlation-Id: bcb88b13-69f6-469f-d6e0-08dc2d54c3df X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XdQb4aSbMsIRJ1xmCWsN6Dta8CoTTWEdcNJOn9r8pZNjPVWcu8chO06PG9QwSbdiZ4E7jBjKTYfc3snsmyO+hnZEF0tbobIYKXwQ1ZcswkaIePgDVIeRR2MJ+HyotbN1pfK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GwsiF/0f9h7AkXXYa1VXZ1CSvWbI9VMtwYXRl74w9ftBX32zKdJLBsq7QcBQyDEOBVt/I80iOdzJ9KicW0CgheX1J3h1twYvylzlL7XDRxQwS9wb+gJfa07fziEyGH1lRhVqePzsehsIunW5AYWht17AmlBaZ/t7RpgQYXLwScAlQ5/Mtl7/nqDHdH5eD6bNTHaOJR43hY+tsOe+L+cVJL+h0ulVaPzxmhZeSK7O+7pZrJTuQEGeoKheloGvlV9JYMRu4FzP52RWvSsFpgApYRylyqBVfs+57+x4n+5ZPb8IwLpPawFFBpA6s25ITptwXPElREFiiwqfU8177OPpr72Y/ycb1twREQYW7jTBcPMVcRh1awhPpUt5uGCe8T85u+T5pAEg96E2qr2tJd/85tbcQwUbBDLlcIalMiKu3vLLB1E9scw6dVfyTohoq1hI1u52SKQ2COuDjr6OtxygCHoLUlR03t/DB8d1Y6SIuBdts+BjSg8t+/WWKR7fCA+QXgtywCOPAHBfFFH0bVtFIhuNo30OKAWOt+rzyIb+QwLhl8baPkkCzl4l7tkIa/g20rQWtlj/x/jgYdqJDWKgFQ2Qc/KTvacNIcpCL6kFsBiLeU+sy9oD5HICxxZ5J+gSjpq1aMrTc7/xL71r52Cm975zVfBuZLvc8y0l5gGcXyVHHLdnn3Pb5NDU7riGBdjhOf+rCLQrq+9OJe/wvBkeyriNgmGxjiDA6rnpbC8tTCPF/iutmQlVvLATXz083yrKUi4m7haCvipQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcb88b13-69f6-469f-d6e0-08dc2d54c3df X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 12:02:06.8661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P250MB0157 Subject: [FFmpeg-devel] [PATCH 1/5] avfilter/vf_signature: Allocate arrays together 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: LweNcIBXz/V9 Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_signature.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c index 4896e8f2c1..eb48bf773d 100644 --- a/libavfilter/vf_signature.c +++ b/libavfilter/vf_signature.c @@ -250,14 +250,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) int64_t* elemsignature; uint64_t* sortsignature; - elemsignature = av_malloc_array(elemcat->elem_count, sizeof(int64_t)); + elemsignature = av_malloc_array(elemcat->elem_count, 2 * sizeof(int64_t)); if (!elemsignature) return AVERROR(ENOMEM); - sortsignature = av_malloc_array(elemcat->elem_count, sizeof(int64_t)); - if (!sortsignature) { - av_freep(&elemsignature); - return AVERROR(ENOMEM); - } + sortsignature = elemsignature + elemcat->elem_count; for (j = 0; j < elemcat->elem_count; j++) { blocksum = 0; @@ -307,7 +303,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) f++; } av_freep(&elemsignature); - av_freep(&sortsignature); } /* confidence */ From patchwork Wed Feb 14 12:05:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46259 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c493:b0:19e:cdac:8cce with SMTP id eo19csp330765pzb; Wed, 14 Feb 2024 04:04:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVV23195HJmxz4w+12hYxlejZS/RNQ1HKBYNGkuUZqkAkps3BMHnZhnE9CLFrfBDyCuerS0+9RHCg1QOrKt66uI4hdOx1/qC+MXQ== X-Google-Smtp-Source: AGHT+IHtVqOnm2bex2zjAqw5XMJ5DZvYtAvGRCUiFnzYD4J9uyB3ve2trb5aPiBD0GcLu6Ly17rH X-Received: by 2002:a17:906:6812:b0:a3d:2222:7f84 with SMTP id k18-20020a170906681200b00a3d22227f84mr1529722ejr.37.1707912249839; Wed, 14 Feb 2024 04:04:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXh5WObtdVb7iDk0zjwtr+MwjM0LJu4MKzgxkywSncj3clJkAA0t9Ee2EAqLQFVbgl6xxKXzWeG7DDG7qO3RQc9DDsSAqwQZ96s2f9D9nm2V0G5N/OR/6aTUdcdKx7IAM7As6RT6Cp6gpRuuDWs1bvruHJPta9xalT7FbKVqwMXudI6Bm7oHUjNm2jBTdTaPTsC9Y2KRscHEfL/9ZTt+oFn8c7DLrROod3BZeJvz+I6lQ+m0ZsCCFWEGY/P8spRY3OIfK0SSP1Gsg2mg/wh2tG6/Sy2oSVNuT5GFGsS7b+OXM3Va4vV9nStcT2Wd1ED+e+KpXnYfAxvMj8Hzm/oSUg4CJDqmGaBwvOp9rAv55Plin9zw507gt5GwToKKvhe3E5CyQxj7Nu54bxpLGuvOcnmnjHkT5pPrfGCLVzwDjh3ky+JOZNSKibbV9jl4m0gc5McourEEiAPMhhZ80DqZd9IAPzIp+U+Hl8KnOJJFnA4QMTY3ZrfOPTgyXfYgN4Mr7u3GqNT9ZqbVH+44gh6ezgBWoYEw++vxWsc9Lo6WWxXFkXP57NUT/5dh9oRXouDHnr92w1zwyaa7+uvHg+BbYmeJDxBB5A3b7qN+PUHlkjfa4maKiIvyQOhLFt15gL8tzncQmPpDhiiaUxF/BniWgZ3N2w3gugRwrpTXHv5huVvU09QqH8koJEgCmuAt3jjCA7lo0AVta63SNpk+54Gz76nqdUfpeH+RL3XvhpdbWxDN4mLiAYXSvHkv5x+A0C6FFiT/89QDrbVgn5OfYz1uqlyYMo48vWxJnwLCWL8EQcob68xoX/QzfbjfH2VK7sVCYfZ+Dh29CbVRIuQAQNQOIDp/32HEFQl7E03w19f/+2OB87aC+igVDP02qtBgG/X2PSsf/ry3nXlSVc7+9FWAmQGEuw0xT4UldU1QaxSC49dEIq7H/jrr4rI6wlz3Wv7IfVskk GhIXnqMhmj0slhkkco5+3fX6bBDnHXYNTWTQWqNSMZZGeMwboILqElhdPhe3KOnXiOqxMFXWhAUnZx+SfYeIrQ4J6bKX3s4rG+2EVfRj4r19HREd7zlaq3LSXBjZykXaMYeMMYBqH2UFHwKt0e20cd7gg1e15VKvo1Z6v8pPClGwp9bJNPEo2fvW8ZKLVQzY3odFzl4r6SOXY/s8hpDFIBWH9+6Wb8bl4kWCO4eHodv+9kQq8Yi6SYFb7NEr9wagtoQd+qpWI5kmzhYoe6D+YVpdKR9Dg9bsqS5ImEC4Yff1UUzHpTezThWH85lDCP1gN9iABqdM49rPRDll+5iJNp7k17Lzh+XeUMgm161RJOwetKmy3qfmrzqbOfDPDVhyelersiLnsXKyYcWhhc/1U7w7UKXyOdfvVVBB9LT9PPuBpK+VNb3ON56oHxFXjxEuoWbj4d98jeL6te4UL4iIwHEbmChv6fXV537KMyGGg8bC1OOa9zr+w1OPMAHvG21IxxaE8AZnRtbg93JnV/60jQU5rxhLOuEIaIHuVUqojr1vRaQqtAvsTwO1Jqz37vBX9+f6CKgppHA0KJFRR4h8T7jiE8MieMyMGo34zxL75K9gMRNjGTlFY+wchCYnVjhkDb9Lzf Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l15-20020a170906230f00b00a3d2bafe1acsi919748eja.759.2024.02.14.04.03.54; Wed, 14 Feb 2024 04:04:09 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=qW6GvWoW; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13ECE68D1AC; Wed, 14 Feb 2024 14:03:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01olkn2060.outbound.protection.outlook.com [40.92.66.60]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5569A68CC25 for ; Wed, 14 Feb 2024 14:03:46 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgY8q9qao2+X3tE8j3n4ynIAY4zmgWJ7btaWsejnO3UNk6+JxTidh7zC/5E+RSTWYWS4NaAi303VpjBrFnUUIXszhI0GHIAugx3m1NLoOGnDOjUOB7zPtMGh9kE4k7uEpzuAqcgY2pVWslsRzjZHRbQLaZrE3VfZZLUshcItgxjG4aE6AMqSh1NJe+5ACZToLM2pUeDF3ydrnz6Rgt5xad2KOjR4McuxKvBHmlXKx1fnTnEbQ2AMFVjWT9op8XuSs+QMUJS3VgCnr67fqQk6GeKx/xZlnegGsh1p/Wgg5rMUT7PIeEqxQY81VHMtj+PbTsv6cBni00sEeqbff2SHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WbW8AMgmV+6xdg5lwGaJZ62uISzPF5c3MAFEaayVnZg=; b=Nuodj6YYf0njNmMhaVNIW4d7E2lAWw9PmqQdPZB+Wxeoxx/qvTQSUDTp3EjMf7Siop36Yw89VppO7HxkQ0xW+SdHRimt4tztUL+RcrBxSVmTcvWbs23/o/oBNp6jKJBkPG0SiHYFujwsspkBgE2pq74LKo9y+RjJsysMsOuDfpLML+JCrTtZnEP1P2GDaf4iB/YTgFUWuI6EV3FY5I4wH1cy/GZV3GmZbq6cO+UtPf7b8xjCmqsSObGRH1zx5Zd4CSYqYEwsn51Dur+OXLd250lYTE3Z9zVDwhv6By5eszzo5dJOXftYaVIjQNqcsfYrOP55VssAg07liB7rKqQmrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WbW8AMgmV+6xdg5lwGaJZ62uISzPF5c3MAFEaayVnZg=; b=qW6GvWoW/m5lM3v+zn0nLCSzX2IEK9XvOLZtwOH2SeUcghZYpqQ3daVgv/wmEoWkw0NNXFHaPP78qF9srOowUGMfGRqmwk+79bCiYvq7ySofRafjTUbyL3iUNGkcrKC2W+h86lwCj0pubZ1xeaaBtwl5k2S7JJ7RJP2xp3p1TNKhf8hzfN+XQIy8iK0yCgM+AgXOSwpxdSQYUBvcVeCrSgSd1qe+sbNnANrL1cIZj20Tt84p/2oBx+cQFgF2o21PiFPh6Moy1ZO74iM5+zKGN3L8Iyqh4r013KHxw/tBYXCowFUNATLdRF6Eb1MAUo6PUR+BSU7jK1t2d30xFfO5Gw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0157.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:320::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26; Wed, 14 Feb 2024 12:03:44 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 12:03:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 13:05:31 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [IJVXecyE8JI8f6ejOFjj5v8W2iLhTJb4] X-ClientProxiedBy: FR3P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214120534.587472-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0157:EE_ X-MS-Office365-Filtering-Correlation-Id: 52963119-12dc-465b-31c2-08dc2d54fe19 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HKbmUiA8Ubv2EUSgRTSBLSLcwIJTdqPe5ft3pFGrnCr6BG1Z0lyFROXpISKFP/PTUVQkUsKAJncaoWa6LaZjO5s7aZ8zQyO9ysnuVNiSPjvm0ZAzvy5Wkf5DxmmDKCePGhGHOwVrdhRnTjN9c7EHA5OLjfJColrgtIlHPA41sizLJfKlkZZOvtQbRRUkh8xGvm5v3ylIEigYBYU/eE/pTc3H7ZIfj8FyjSY0RkwYXbH5eNRJpwCZgpisiqQtgaSMWUH1+6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T97TW6rVHQkpdzuRyfl08XlV52UB4v/5YJITbCtrqm96plNveBBn51WumQj0MSOZ1sBfkiE4GpocgkrzuJEhEalGysfCt2dJz5QHxjT5wi7f7BIT0WLE8O2sZzaB7rm8mbPvpq/OvQ1IEh+AKhF55u+mdzCiU4Nx4mVH8fTbMqHanLqzjcPrPBnMrnvW5ZYtYaQVWCcIm9hunWlxy8FcynPoLVvxV4r/zEAA3dn/DtLmKc5z7UUV0rqwqYKfT3r1ozBZl+ApqMmOjs1yxHnBTSNsw9zDiTjll6jtn+sTvEMgiTGJW8zsNSF2tmx9fDq7dnL6UFfHTGscHyJIN7h0bHyQb1dvA1KBqi1tJmHpQcc0ZdfNv/jqCJ9+ViJKbkHcfwvlFo163xkroknpyA6onPWSp7IAJ7AD8ZzgFLMGQ452DBcqe9bq9rKedQ5gLhdek4W9MFwTIQ+XRZFTKwbsgmcqXViYqQWvSJNRo/aqeGWge168b6MjiWMXNlC5wRaZnFnLAQDrZBz9j3Cjrmx3Icgxd/UbFl6bKZVHCMUmwiVgMAnBSjHEgUtC3ezTUq4mokXQITgy4ulyxEWccDmncIU2dFD1uFroz6Wm27b0OHHKjhM+5MxUosswwUkX3yu73RZ0Mtmfihl5OrvyGfk06A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52963119-12dc-465b-31c2-08dc2d54fe19 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 12:03:44.5088 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P250MB0157 Subject: [FFmpeg-devel] [PATCH 2/5] avfilter/signature_lookup: Check for allocation error 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: x2PFyWurkcVz Signed-off-by: Andreas Rheinhardt --- libavfilter/signature_lookup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index ad012ecced..90b1d0eadf 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -205,11 +205,15 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont } hspace_elem; /* houghspace */ - hspace_elem** hspace = av_malloc_array(MAX_FRAMERATE, sizeof(hspace_elem *)); + hspace_elem **hspace = av_mallocz(MAX_FRAMERATE * sizeof(*hspace)); + if (!hspace) + return NULL; /* initialize houghspace */ for (i = 0; i < MAX_FRAMERATE; i++) { hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem)); + if (!hspace[i]) + goto error; for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) { hspace[i][j].score = 0; hspace[i][j].dist = 99999; From patchwork Wed Feb 14 12:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46261 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c493:b0:19e:cdac:8cce with SMTP id eo19csp331003pzb; Wed, 14 Feb 2024 04:04:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHiMFKX7tLCR0YmrhbtHRbm33AOao6oekeshXJhReU6qpsWI+Dp1Sqr9+PczeXGVj4//0doyuL8w/lfEV1Zx07PTmDxkfFrwy0AQ== X-Google-Smtp-Source: AGHT+IHSG8zCy7sdv5pi8DQuOipoebzvggmazWZ/OmN0mdl14oiyr7Vlcilgm7qzQn4YTZ3sEK4T X-Received: by 2002:a17:907:378:b0:a3c:8300:f4e3 with SMTP id rs24-20020a170907037800b00a3c8300f4e3mr1932392ejb.11.1707912268648; Wed, 14 Feb 2024 04:04:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV6hpnQ9d1w8zoHJ0oclV9qRMkMlqqJGps01YUDBiraEHVvX27FkpG+aZYPv+qhqkg3a/ia3JPDwm3DC1mC2bbSnHMJiHVYEfCd5dBPHAEhEaPfQEvrP50o1dcZk06S2p/kbM6cjXt8soqibMx03Fp0dMKSKGXnF07SK4CwhRzdyi/RPpJQl8FGwILES+xO/cqEG71VV795v+XVPUZATtT9pR4Ku8AcsQo6mo/aGHIltfcKOWPKbS61snHtaljHsaPTJS22Qya57Ft95ajaJBiBBCjADAA322pn7llpRA4/T0WOU1e9WxxUe9OsCN4iposNLQwQFSYA16JJGRTUxAa5qkCAfHrf59XYriJsQuBOLOFWIldtkGIfPC7adnq6ZNi5dGHZ8w5icnCrBFhtT2wZ8gB/BeKPVwZd8YKyu7V9jzcNdYq/A7wawEv9q2KEhYhQCAxk1K0QNPAhF3E0OPMgiTy/LI3KEMeEy0PrJlqN6L0KTUVRdGs5fb4RbwE/KrBxOjs2hR2k4S+ZTm1NDlwzRAJo5nsVABQFkldI4p7OxDb/yvd5r7u0+k6rerfrf4nWwxdlvbws1IhMpXfBHs1dvzibOlOwcYQNfc4QeVvFwHnk5luQBcCIqUTcmvwgeeN8SzsXcS0r55+Nam7v3f+FvemAZzfyyT02CQSwJWOspUFkiTWa+xFUelIROemV0GgEUNEX0frJDg90qqTuKVTy/M/1//szAsFmul4BncawJEx47+LY1Rfn6YJNXK1T/wmE6xta9/wVwnml5rb+ZyqspCIceasUGwnea8nfzQNXLktSqHJJlIN+h3KgidZ3DdoT/GBN/vW7Rz0ndftJonRvA5DItif807TM9wn/qIWHroragb7FQU+Bpp/eraXxlOxk+Y/fqQ2j9p8fX5aCQ0lTqN0yYYGHyhAL06TfUu3CybNWhP/LxRJ7jxt2VNxk3/0OL/ dm+YzYH6Uu0FxW+6Vjy8YH4gu1YfdQi+RZaOivPN8y5KnZOrSIJpdVO0dICzXE1+uPobu6t1SqimRMHu2bRnmh+ao4rbHMbSEBGoae9qQrrDhr57naW9TJmF/o5ueVNOCSGEjKGJ8V92z6q53sAVMPAa79FOuEVM13tKEnGHfZzGKh18smbDuo75F3kMItZzQdGNgTsC6SVnIKglbDe1fi9m8hjRgJW3IOhqHsfobHi95dPnHZpyqfOMEiuTNoF/MPqnVoZXgU3kUNgy6X/9mCBBMd5we32u7pzVQtYdblhSNbd4Y+kjIsThlK+DWSoDWxomF51uuxzLruUqyeDys9PE8dZQ7wkK+zVV+G3PU+9lE50TOwD2Z+bwRgmVhwr9gULujvmg7eaCSyBK2JwvgcBy16eo7WVWismwEtYHUJWj4WK6zAOe7ak9xzwvcMP0J+owytKVxqXGB4c7SsdSrKcPAmO5rNDP6k0Ln+m7TdF6PKUc/+WzDmD3aXOnWf7qik1AfFPXDLMytLqFnG5skNduTH9DlVp4lXMAXB/Kvizy5WFh5+aiIB4pwSS10bPLtE4k8w1XzssAMSyYVBlKAif1Cu9XsRsRPrqVxMChE4iNVgYxriki2XUNwBYuX2 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b20-20020a170906d11400b00a3d52681373si424979ejz.805.2024.02.14.04.04.13; Wed, 14 Feb 2024 04:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=vOxZT67A; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A20668D1C1; Wed, 14 Feb 2024 14:04:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2047.outbound.protection.outlook.com [40.92.74.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 269E668C44F for ; Wed, 14 Feb 2024 14:04:04 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ecF9Kb2t31idk6hDNgDMQjmiSVi0Or/i9XnGN7X2uMqv2kx/Tl4GILvrJql+os+YInINTB2wIexIxCm4Gu9oHfdcH3rNritDDPKdJAk6/7a8ypJEix6aPXnhrwKZvvfXu9o+PO2hzRtr+FKB3euO7Hud+c78wvwLAgOxl444vLwHc2/3gkhL1wU/4p+belHQapy8PqEBitqTj5KaxGQc7ojnvozUKqzhvmaTVL50Tg9yhTaWy+Zy7+ttWONAcw6F0idVKMMBgYNHuTOBO5Knug0N65C5UQlqHqyeoILdNl7rxhVSDDacUtFdwjk3QdgUheyDR34nP8lKNb0LfTz4PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PyDTUJk+/vskcYGqEpsx/zTClhxC9Uops2+aDuC0m6A=; b=U/ZtaiNgEoFF4glFGzYFPZZAAOjXY12wp5eseZaGxQdyJaxVRJMUW0E5DVcwFYH8BlT4PxqmzbdZ4egQ6L7FBLVFQn2NVSMVClBPdAXEiq9p1CEYHjYFSardX4PiD/xAiJQm25zQ/lRuTyAgKIIy07UvfTt1Tt4xkyE/uL7lS2UBGzBqfU1YAt2BjjyCnDnNgxlJqA7tTSuJHPfjtlAJc2sl7c0h5THu8lh3E30jyzx9gKphj2+glZ3YXXdDJyqQ3XU/CSiA9JqBprDGjSP5Uq+VHVYYcphiXNtUFMv0KlJ9ZDbG3Hgs999JB+hp6YzGrpbAt9oqowaCmRlez+Wnew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PyDTUJk+/vskcYGqEpsx/zTClhxC9Uops2+aDuC0m6A=; b=vOxZT67AuONHk3enOgjrzApndp5XvGSuGVujKognV8cZeN4XqnknFlekffAY8GPfFiBcSjGr0iCoOpIn6bUWPnAH3HaqSSf1kHo9TYZlzZnLuhHyhrS9bn90eU5CO0zCpBasLpAPb66pp3nivoiSrVy4LgsZEKe9noU0NdRSSizvbkSBN/VKXNYmE3Cwc1nClqU9d1ocGtm0jce8YdXqo188ssV/zlTfaRvHx/oREi3nIvXd1L2vpqogIF1NU57sEpdFmq9Yz8hXaqfJSKfYAnzTyIKm7G9ryH90sPjgftIVbhVYabcftjywUmLGaYHxMF7x9xIlRdKCESlYA1r8FQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0173.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Wed, 14 Feb 2024 12:04:02 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 12:04:02 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 13:05:32 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [KQ0fM1yO9YVC7e3Fvzi/ruWUA5a9KlwlSvwmK88ydQ4=] X-ClientProxiedBy: FR3P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214120534.587472-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0173:EE_ X-MS-Office365-Filtering-Correlation-Id: 85a21bc7-fe0e-4753-9ce7-08dc2d5508cc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b7B6ZIDaap6Z/D2Mqm2xuboQhWDVgg10q6Mk0WJmRnoFfpc6RiaCaOPy/L1zZY7w6hDDDzbPMGUVlh/ZV3ZCP/GXNDeg0SxC25ekCnGE7hlb5T2ZVaVM5AVEtR2fzQrwNaK6XdpjqFgIZyr+yUd5tTx4NCEN2gLI5RY6Vy/9uuv7JcduQCQV4MQmb7Q/Uzl9jyXXALNZgLm428rzEuPz6bPAbRYQyCXGd0WIS3D1FJSMITPySSc1rHmQ7tZstS29SFLP+4REiIJ3zgjH9TnUI/yU2IXambi6srTW9cT5DnOEJfv8FN+VVPm/nXVJMytyUKOqXrJfLRKLItUCmBKAEDZ2IzDRxhdATlGVRW+4EYunMTdN2q2cnbylgf1cVQ8dTu2+sOpfeXDdVyS47hNVQFWD2ihr0H5x28x1GrGt1sxxwXZsS7B63NiFppjiU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Wb6wRVtd1zIFvj4zmQaj7QwN6Clx18ZypMOM5ZhGV+g953jPxz3lDsogBaPxDMiKdgsL0Z+dhjym/hMTW0s927AGQgxryQwNvt97qD1twZ5BrjiDVYIk8tLIKABdmbM8+orSVBUeErP5g4/5zcwPpIW2qL+m7Bit7O9Jl7arbwKbSlYqc8/ocyursLlkvYEjuQOOZJIF8EZC1fpaDnkpCEg1GY2FNNgyh6oxg6Mb86LxTmbOSTUDQi4ngNLMq8mm7qFiOqW51DQ7uCSH/Fior6VcYeIFRxzOCl75IEFnt8WTe/zzws6ZwVC1hl1OHwBp4+cDW1lC0KTGOLkrBh5GaoYU3NfB5Zxs3UFROfZxUTpfe11vmzhPsmvJhw/FBpXyMrZgmvcR0UdGwuywsXs7DXeb4eEz8NXPFMKBsB/lZ3hR/ZUVL9Is9DR/i4ON2zCKMkg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85a21bc7-fe0e-4753-9ce7-08dc2d5508cc X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 12:04:02.4670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0173 Subject: [FFmpeg-devel] [PATCH 3/5] avfilter/signature_lookup: Allocate buffers jointly 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: sGyb3QtnF1qO Signed-off-by: Andreas Rheinhardt --- libavfilter/signature_lookup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index 90b1d0eadf..3a42737e1a 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -205,15 +205,17 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont } hspace_elem; /* houghspace */ - hspace_elem **hspace = av_mallocz(MAX_FRAMERATE * sizeof(*hspace)); + hspace_elem **hspace = av_malloc(MAX_FRAMERATE * sizeof(*hspace)); + hspace_elem *hspaces; if (!hspace) return NULL; /* initialize houghspace */ + hspaces = av_malloc((2 * HOUGH_MAX_OFFSET + 1) * sizeof(*hspaces) * MAX_FRAMERATE); + if (!hspaces) + goto error; for (i = 0; i < MAX_FRAMERATE; i++) { - hspace[i] = av_malloc_array(2 * HOUGH_MAX_OFFSET + 1, sizeof(hspace_elem)); - if (!hspace[i]) - goto error; + hspace[i] = hspaces + i * (2 * HOUGH_MAX_OFFSET + 1); for (j = 0; j < 2 * HOUGH_MAX_OFFSET + 1; j++) { hspace[i][j].score = 0; hspace[i][j].dist = 99999; @@ -325,10 +327,8 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont } } error: - for (i = 0; i < MAX_FRAMERATE; i++) { - av_freep(&hspace[i]); - } av_freep(&hspace); + av_free(hspaces); return cands; } From patchwork Wed Feb 14 12:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46262 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c493:b0:19e:cdac:8cce with SMTP id eo19csp331016pzb; Wed, 14 Feb 2024 04:04:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVX4tQrss8lbWZFR+F3CTcESjLFPH75eUvE/ZMudfPBdIIcL5/ZZxqUjZ4CkgE+f0feF+QCCNj63Z7fckj68QfFnGGrUwRL2+CFHQ== X-Google-Smtp-Source: AGHT+IG0Qiz0P5gWDtDWdinyz0KPSDgEgXNva7zavJc4Zum+pIAg3DDnTnBW5zdatn4dr5v6BD/T X-Received: by 2002:a17:907:20a2:b0:a3b:cd71:b8b8 with SMTP id pw2-20020a17090720a200b00a3bcd71b8b8mr1546463ejb.66.1707912268927; Wed, 14 Feb 2024 04:04:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7JckWwpt6uxU3IfMKnVw7zClo06hCCYwGCniYhTO9I4kvZec1Zn1F7CJxrHEf10ksS3NAzX2BXeVBm7O8x1GDZWNGycMYBiBH0xZxlbA0ZfwHEw/u+o3AVh8Nhmg7SY/Dxw04dfKtQgpMlnwKfedlgfPS5DDwE+rATcXbALUQv021NqodGmgtkroxVii79VEATe5OsD6eDW+krwBltXRLBLt3PdEVWmg+EF2lgKGl1l86X5dXVbo6VuMP5IA0jhMB11C4kKyqOGC6alF+w/K0iYop3gVTVTOHOtSzNa7Rno21N2C5PS2L5c8xxrRpHCzAkRiUx5Wfxt0/Nq9ITe1SyLx1fmuBet8UOVd8irv1bqOPDpxTiuERQCt3qlsSTBHzMcl5rf48cjFc96Cx38WF7kjjaQJOTOlA7tLRBmICzv4qzOFuLjwSvLIeNfYDdFGSjgaZUqOJAct2RbOrc3RvHPCGLSwy1v56IV1X8EFZinuKEB/O8gCIybbk/iXqa+ECp8Y/NXa6qlMkH9thcstMDD+lggopcG1vldS+vsXl9T5KaPv0MY/3Y8qdx8hX2U4VqVYOr1cacotDK1Rp7VigxvScnGqC+mMNm9CQ0NKOTJx/X45lzFUBpEk7td2muKgyj+5dWhPnG3+7U5CCaOBtZhY9GvvRViGS3aa6E2XENR1le7QuwA+ZV93x/RJK9pxPbMBml/twJj7oU6IV+eaN3bB5HdjQgPnoRnoe/VJ3vt9XSfxueFnQ1GCvB/o0OVAOZIhY7W4r5YqD2u7P7B5vDQ2EEvFX0z8tP7zIVEJCsrn2WsNr80m0dDFwVjz1gbMSDaAwOAiTbxeNPoXbE0/fSVqFIIdAwKg5wxiJXRj67HCLDmFL1gCwVH5DD5FICMViAygppIi7zFBaum+jf6N9LR6SXLzpICnGB5gIzV0N9Gi0VBBJqil06oJHKE9gReOuxv pHskJQQIu9mjLM555cBWZmDizhMar1UFes3T27m2boBsYDlGIAK7d9OhAcIzI34rPdAzZysrAkSc8rpjVQ3YRfU/2tTR7HWQ1jAEi38hhLnxuiw8U0BCYPoC5YqoeXhgx4maYTWQmoAOEjsUawsjOWx/Rqyz9+iNx0U7Fm7qdQvsUSMfXe5elFwzlVQM6/4tg38c34fxhgeLN9SAWvZcShK/YnXYjhOhq952x5XwdIRlNRdWisQ1Aiqn2/EaN1uHA1EAOt62ELAIetjVwGMMXksrUmmwO4nVScoV+LLPPplTl9Uafvpo8Mi+yGcr2u9TWZexhAWdpthWQBCJznp6U7Pt0JCF0pbeUTnbbQgPruzuQFOvBbWU3qVqdOV4tVQbdYNeRmLOaJb2N+JYod76MDD9tmqndYIxwDdm1Gavs5omzo0XUcQRkD0BZn9df+FcOPXGseIlcGWLcEh5w4tk9xO2lvVQKdF/CvHvy81ySxPl5oDcru+iPQbaHbU41N7C8cxf5JqOOhUcWO+JqKYL9cfMmyDWY4WYxAnwrNdvTGw0uGpP6+eY7X221iVM3pfBFElnpaDqKUKkvLTU4Gss2FodUXizh51uYpMWt5jg== Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ox8-20020a170907100800b00a3847a4c8d5si2190597ejb.538.2024.02.14.04.04.21; Wed, 14 Feb 2024 04:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=oqi4GAsu; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3470068D125; Wed, 14 Feb 2024 14:04:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2047.outbound.protection.outlook.com [40.92.74.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA84768C44F for ; Wed, 14 Feb 2024 14:04:09 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kmbs4/GJxYk+tsTNGckyGsHvzf2PT9kI/FVBXs0+DBA79Xz04AopmPmmMEMP7Iu9sGrcKxMbc7q2uHo3vvOuWnE5U3sxaPZHph2/Sb7zmfZFDrMhUmZk9vtnS1shL+W5ByY6PvsoQ2Ro2l7+Jqwc8ZTvldCaOEnXNCP96eT9e2Nd/72d0S1P75kf9aIpNf+tk7xMN2Qh4KSzlaOeItoqcmQL/lkBBXiDaYDgnAEJJDIczyjgC1RB/2g9/XCmE/JQlQ9jkfTBY61xJdPk2jONBKeLB4wZr+ZSQcPXjSQUtX7TF+dqNTd//BywvWVU7blwtGXKWL9qy3YKQhsR4j9EsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TGJ1WcOWJ6SOwZFi27m9PElPnKMoSSXDYHSycFCk+m0=; b=i6J4SJ81OQJ7CShsPdtKaDmH2//N1hg4N8OAHBvHBaSkDHYYRLNopAZGIuoU8S6maGmdVQheQih39BMv8FWoOMQi/wNwinHbqix8VHk+asJXtqus+flglUlnaIWQmlJ8V6po2ANMRs9ezfR1JqfWXQC5Hg+A56VT2VeVdHsZ2ca7d+4BclCNrK3ApMum/A2O7mCLxdpMsvhfXfeiaGC3OpeLVtDJoZyDJtJ5IBmIAyPoUU7h2yiHetMTkyeMDpvvUIA/o8oFLWxiaZqwoP7kV9ixAn5A8CRR7P+R8Y2RqHJaCs2W+4ky61x/3WUYn5DwE43eBhhfphxYLDqjjSmC2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TGJ1WcOWJ6SOwZFi27m9PElPnKMoSSXDYHSycFCk+m0=; b=oqi4GAsuIfP1PQhtwoTZt4EBbksvtlyoadbvianvPOYcQWHquiz3zjLY3mBhX1NJicV4ppvjxegvg/mC0gUykcZv5k4i8nP5Ai7a/0OTHkQtNUVL3QIQYaCykzMlj7sHPgb4HMyb2zZ5dxUAEczFdzJY/wYH/C7ywdogBl6CXrcwF4qKAs1lzjeqLdhrLmMd9OJJto/snfoUp5UuPrTtG85flXPBYRgoGuk5jJ5J/lD6rDRiwvPCl2iovXnIX3AcDHwT+zjItx3AndItluHxRUqtCW+Fpvj8Jon0ZzflO+s1GZuE5llNNQeWjp0BO8yoMYcNc1urOXAt/8hVdTr9Vg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0173.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Wed, 14 Feb 2024 12:04:04 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 12:04:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 13:05:33 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [kCw2XvF02EjxWlQY8MPfNIjPor6bVBvEE+Iyx1puKIc=] X-ClientProxiedBy: FR3P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214120534.587472-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0173:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ad02d29-d1b9-490f-7adf-08dc2d5509d7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bMXBs2+MYt0g1IdmoSPfA4fnh8kJ3Si0Cb0y1Vp/hVEbH19C9BJFeV3cEgBEOvP2AB7oHZ7Za9K6EZwLDdVU/ocIPiVIVuBVmJo/vSAcXXLSye0TC9+PVzWD5Adxtw5/FVJsIbUl+gxYiSG7/NqA8EMPOwZ3rNxMxhp4T0Yl42TkY9bQIcJNI4jlnLAVzbtkpfAyj7V/Cg4wv8u4FelmZRrCHH+v69j6v1SXyfIAfy1zGnJRwM3My7HhmO8mdVXruW+CcCL6Sjgs+ugTksQwQlAprIYm/nlUccwl/Gui2Y2Iu3xci+Ep/2KjZcHUI/t3qivzC0B7uD/Cv3i3Q2RxJbUdkREjdV2/PzGa7eQ7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JFmvTZRcNqUULC/yaN0M0jy3VTzw5bncLMYLMRtWBqNLRzMzwYteezqMMOD0/arDJaGISrYwGPnM21WDLFNLMTxQEVJtZnfqjgmvqDgSNr1rJm/IIVwzRCbzSmovzEclgP24dNZSiWlaWzJbj9RRY/jPRIRE62qRjkkDampuhR15MaTEfFwk9VSSEgOpw+IaaItAkSz7roaS46DNoOF/n/OGX+whBf+WticyXvyiMQHZcScP8TUQmfBMwsBWR+94tu+jFE9iMNpS53KfetJN3xLOl353+kjpxV6Sa2dsM5ChEH91f6POYP9EXabmvuqoaZIgcaLUGRPFlPhAI7wDSuLmpvoHqAFsh3L2474mmqXa7V/jNsjo7myeMCfwv9FXlfqOQVewNjwJwqPmeRULFesVt1+YaI83QSK8pV6RHpPQ0tOmwk3C3jIeuJ5lNfuT9iSAo1N1ETugq7HEHvxkhQJ4ulfckE0HxzYuWJ23ruckVBLHgWW48Zbn1L6ODv8pYIH5ygCLlGu46L+1sh5ydw7zgBasIFMHrKN+GtKSGow== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ad02d29-d1b9-490f-7adf-08dc2d5509d7 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 12:04:04.2158 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0173 Subject: [FFmpeg-devel] [PATCH 4/5] avfilter/signature_lookup: Remove useless error logs 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: SGBTvIiumu05 These logs use the wrong loglevel and are uninformative; and it is of course highly unlikely that a buffer of 56B can't be allocated. Signed-off-by: Andreas Rheinhardt --- libavfilter/signature_lookup.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index 3a42737e1a..ff0d23c5c7 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -297,13 +297,9 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont if (hmax < hspace[i][j].score) { if (c == NULL) { c = av_malloc(sizeof(MatchingInfo)); - if (!c) - av_log(ctx, AV_LOG_FATAL, "Could not allocate memory"); cands = c; } else { c->next = av_malloc(sizeof(MatchingInfo)); - if (!c->next) - av_log(ctx, AV_LOG_FATAL, "Could not allocate memory"); c = c->next; } From patchwork Wed Feb 14 12:05:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46263 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c493:b0:19e:cdac:8cce with SMTP id eo19csp331169pzb; Wed, 14 Feb 2024 04:04:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVuW3AnZP1rgsgDuE4nFJRPDwtVEnyXITJSSKgZ70ugw4Rrlt5QXzjMDcR5ypuwCd/2TTnamWkagXido7P7RrqD1mVTyFpVK2bLSQ== X-Google-Smtp-Source: AGHT+IEKPzmQwxFpYqJtgkIKZ2ydGKi7WFWV7ThTQhV5WcrLnYSeRzc1SC4X+6jf/rrWyETMEPR4 X-Received: by 2002:a17:906:3591:b0:a3d:3781:6edc with SMTP id o17-20020a170906359100b00a3d37816edcmr1300738ejb.55.1707912282116; Wed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YykZ8XoAvscCFipIDAJOhzYIr2scZSDnA2DaoqTqc0YX1P1k3iGvFfg+JqXynTZZkaFYmy/bA+2dV0673ABWsV/ce7GDhwnbQ0mzQDGpGXUlvvDwUOMFFAwW5tZxmNPo5pbB5muwFeypAYSqSKXBBPAr5V+r+P8dGIgVPGQIlfDvUPnnYFovZ7d1/RJtOT14QNAP8aKRSJE8bhwICCQr9ohPS8f4VPJUoYQUaAScKm3PEIDl7FloU1AGznMwnn62Bkrxb5dWbDuoSKbqQ9avabQy0E9/Dvx1vU/GH/kQUkd8IZwM1uX/ITnk21F8g/UoPwE8bZRdTB8XjfukTjvWt6YJTWk1Rd1PsaPeDgjZleGlml2l2vN7pyiTsQJVbfzO2kqMhA9NPNXbrqCRKNdyWbA/VXwYjafLQT8MjoOZqdPyHnpgTts6zgRd1+b5mpThEPsHAjBqARyfeYwbyoV2srTkd9ZLo5JJVgFDGMzx1MNBJKlPoh+W4PyMZkNDZ+YDTkJtRE/iCqgZNbKnuR+2xppSEBh39uXyjuh7bc/PplsUoKKk8V7ncIowVz778p Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id pk5-20020a170906d7a500b00a3d18b8d38csi1198650ejb.595.2024.02.14.04.04.30; Wed, 14 Feb 2024 04:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=YHQufXv3; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B1EB68D1CF; Wed, 14 Feb 2024 14:04:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2018.outbound.protection.outlook.com [40.92.89.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2118B68D1BB for ; Wed, 14 Feb 2024 14:04:10 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VWAs+320o0i5evucJ7RB8YjVWUhzl/+zUqpKFiC6JSs6soxAiVwtc30OiWqZ7HNGKhAcgYOk/ZcBHwnXGAmiI1kBupi+y87QdEqRTBG47RZ141WLhAwYr/UO2q8PT84vomb5aELa5MzzkuedVv3I5MEhqDffhw8CuDbIf/8yczkMxlkJ3QFm00829F6ELUw+bv4a1SetQqZSVuSH6Rj6T3mJnQWIpW2CM1RhdXKLLLdL1c50idqyfFrzIJzwg1G86H6B4lzt3MZT/iMsOs7tJtUPgFKAs+XCO7/na1z2y3hBLplRrRYzPq/wGaaRRJxnamG6db5DM6SQh32QIpUwGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q0xRhpIktF0rsRFCaDqJxw9zkMi7/fQMfHT7mV7rS3Q=; b=P8T1xLRufhu5siO/jagmExK5G3X9Kfu1v7nT71q5Qc0s8RGFQg/2DHx9muLSWTF0RUqXLABHGJAjxMIN9iKH1xtE17YhpG2mJZdzxaz2d9hu2Z9JwrLqjrODDDIs9TRyNuzlOARMZ2Ymq0x2az2tdIXV/13v+3tYcRoa0G+nRCPZO+CR071EQXMeImhuyHu7G9cEzXlxHLwzNTSBrTs66KbCHYyA7FckEMVrVqd2VBUL+Jt35GFcvAU8s9NYOYaHSp3AwcUy86Z5w0yfA2Rl4l3Zb9lO+mkiFRrbAgreSI0XIUjgsxvRmoMsCltc5kArVSuUxPcMea1KAwe5xwLvvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0xRhpIktF0rsRFCaDqJxw9zkMi7/fQMfHT7mV7rS3Q=; b=YHQufXv3lqPJsMD4JAZRJFM8890iCjrgnEPMw/oIq3m0c8lX73UoZ/TcYorviQ0v6Sc+T5mgoTJw24vJKjseSY0lugZyJ6UDGlwrttBCfjHXLi3JyDnoVThppRNw1jgGliuuOqVBg/ldox6Y/d6dnq6LYwS20aTjw/yh86MUitZqSGrNi2A5Yih9HBvLMiguv5yc6ye4af7TRhCnovkY74BKRB2iHe23pb56Ijz44662MWIU7sF0lFNxnym514aeMgiRYIFBZIXUGJi3MOfJ5VYQjnPaO8eyJqg1C58CRy/TjInY59PTe8x7jexEf4V2jHJBWkLQyp2XHbF0w3dxkQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0173.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Wed, 14 Feb 2024 12:04:05 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 12:04:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 13:05:34 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [husQLO5XFDg+JHGuCyJNy60hokhD1ngkbuC1JHTlo2E=] X-ClientProxiedBy: FR3P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214120534.587472-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0173:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bd724b3-7edb-461d-d960-08dc2d550a56 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DA+fUIWVr/WO3sv66uPWjHw9vGbMc9fDkpP3z7OQX5BWxltR6xoK4iqenytlNoliZCVxBteMTa9bf1SGIZ+rNaH9XkAlaYyrP1Fp9biqXxy1LNUltMDaHJkexUEFYx6TciSaycowl4bLDMw2V578rbINLkUTgBw2sBFatQSNRwPqT88OsZVmKq+0HvMwM/gZ64flrzFGAAa4Dea/yMyGgi+jd6/crrbRAcPJ0NJUBuIoZEsVKJYN0odmXzczeSdzoaE+3D6eT3tNoriS67SpxlPPr0wcdqCz4+0ss9zb2qt8yt1+lq3a1JAPI0GIAZT0kuiM32/exHTUnGcRtKe5PJjO2TMP0ehXBpWLHjBLfbwy6UtI5yzBunv/mHq0gNIFkmrbNfzABmEGmWi5hocDcT+Xo++XZwsviO8028aPN8ka98zVSqWKPUr6BntyuCw8mCYAHOvDmCWLPO7xDC+thqS+QbJFAA0HthrA8juRTOSAozVRmMYVyVDb3glWxbvgV/p3LNa6gYFM2KY9MmSWxSCqsAmhXJJ/2Bn3yl1mOnXrKwrZ9cU8thLHyymAb0UCzi5wQ37f0XC9RWEayOEaBHAiXf/eknYcuXa63RwsTZWctMP5M7x6/m+uSxQHhEep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2Q+FhOGvpY7kWNBORonwOirLoxOaIQPNgzsBDvIg1CnbW6S/oLDuJu3bwvXaK3j/j13ZGhsNtdRyJfktG5nLoFciwYItsIW3LB0Tkw57FjAb9zebaElVoMDfYEi2Um/G90C1+nJ3SjUC+Wxi214E79kjSezDXBS9dD2za8+7+mIvFzBmF68vxNU/E42vKTLfTSrk1VR0PlYeA+tMBXRROvUvwbteumHFqHv4MhNedNV33QBcs07QWVCfK3YjRXk3J+ilbbLiUEx8AdZVj90ry1mg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bd724b3-7edb-461d-d960-08dc2d550a56 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 12:04:05.0594 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0173 Subject: [FFmpeg-devel] [PATCH 5/5] avfilter/signature_lookup: Avoid branch when adding to linked list 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: g7lOtDiT+QiM Signed-off-by: Andreas Rheinhardt --- libavfilter/signature_lookup.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index ff0d23c5c7..9c69c02fbf 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -187,7 +187,7 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont size_t i, j, k, l, hmax = 0, score; int framerate, offset, l1dist; double m; - MatchingInfo *cands = NULL, *c = NULL; + MatchingInfo cands = { 0 }, *c = &cands; struct { uint8_t size; @@ -295,16 +295,10 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont for (i = 0; i < MAX_FRAMERATE; i++) { for (j = 0; j < HOUGH_MAX_OFFSET; j++) { if (hmax < hspace[i][j].score) { - if (c == NULL) { - c = av_malloc(sizeof(MatchingInfo)); - cands = c; - } else { - c->next = av_malloc(sizeof(MatchingInfo)); - c = c->next; - - } + c->next = av_malloc(sizeof(MatchingInfo)); + c = c->next; if (!c) { - sll_free(&cands); + sll_free(&cands.next); goto error; } c->framerateratio = (i+1.0) / 30; @@ -325,7 +319,7 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont error: av_freep(&hspace); av_free(hspaces); - return cands; + return cands.next; } static int iterate_frame(double frr, FineSignature **a, FineSignature **b, int fcount, int *bcount, int dir)