From patchwork Tue May 21 11:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 49099 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp5150315pzb; Tue, 21 May 2024 04:05:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVrLKWi+07+xM4wsAe87JVDmCiOMFHgGh1JpomVVjWgL1a3ewYrRziPKboBUuxu3Hb8reYNrYG1Jeiffcjg1dZLiSUwwdbvm/WbOw== X-Google-Smtp-Source: AGHT+IE/jicQqiZaHw5u1ogvnVq4h6cqpxi3e38Yq6wLeDgIZ2lEoFdwV2865XHDsmZt+1NTeu+r X-Received: by 2002:a17:907:9455:b0:a59:b88c:2b2a with SMTP id a640c23a62f3a-a5a2d66a7cdmr2531446866b.50.1716289505953; Tue, 21 May 2024 04:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716289505; cv=none; d=google.com; s=arc-20160816; b=DHZCWdzKC2aAJ/JhNpBVY1WocIqzjyNv2EjNxJHMmQ9KiYjmNQFH/8mhdvxOEFJp2P Nzeam6gKW7NEXa1+T6euqT3P4Kj/PdyPL98iIJf3M4CQ3Z/6B8M9mB5aP9q5cosPk+aD k4V7Gj1yt27qmrYCo6dKWSV5fdHP2LNRHgBNxdJHmG4ZrCsTkiCW3rur1E9+4tG1Yy3O 7IoPCyrVqITJoPsxkgNyf1rsw7Bru9G9n4WslPCJrJP13ERsi1sXelI3B0DZMvKR81Js Us8CQMusp7CYkjZJM0bOAw2OdNWog65RNEO41skRe17+V2Aya2VofZZyHXSpv+ITvanB Levw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=YI/T5NGoMvKtMOM4T/4ECt4f5OmZajAjZJvUP50QMPI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=JKJagixpW9Fp3lflBFMtFbrByvqwZc/HvNg43Lzc3SdaxfxANHqpDHtECgTlXtKqHB NQ2suPiXsKaV+ByCVt0rYV74hh0VRAs0W+kZ+o3nNFE8741pu4hS00JXE6udER2jXd74 h6E8SLdZwEE82ScP5jLs63TA4Uuc29atzTgDvxZRoiewExZMnxFCCZHgHtVJrnl2GEBy eFK6eqpjb/l2MXRXvghY7cczYQrzQI/AHfggupMrkqXCft1X98h9AvCHAmlk0yfgqN5t GoGdPGUzKP9HfK0SweWkhVYGu9HsG/FhLXa/PxZkbVAv7KKX1r8q+ZYi+jEmw+YQmXqO JQHA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=UmFkxVBU; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a5a17c2c2a7si1479708366b.960.2024.05.21.04.05.05; Tue, 21 May 2024 04:05:05 -0700 (PDT) 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=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=UmFkxVBU; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 27E4568094E; Tue, 21 May 2024 14:05:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BAC7068D02A for ; Tue, 21 May 2024 14:04:54 +0300 (EEST) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-523b20e2615so6118533e87.1 for ; Tue, 21 May 2024 04:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1716289494; x=1716894294; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+gr7vAJl84gyu0xY4STz8zJjU7RxY3OrpBsCUNpNH/A=; b=UmFkxVBUYlEnEX2mJS60e2SGQ9agzBig5g6JEmjqvzBZaCz2XPMOw2K+vNyf2zseMs bN0hCDw0YrQy9wNddwfpRvUnsQ5EKkvOEsyBvr7r0eBiqAU+7zFOEPLbQD1vKB0grgvf 91+sPvfF9KOniIR9g11xZ73uGqBLUUNmxTzhGZ0ezQg9PB7VqETZ1zHbIfRAlXSkkVmJ +FCF9yKuc101zYfvk5au2VygvzLXkRQ9H7IPVHQFbsfYn10xGfjtHz1VoxamWDqMcJam ftQFDxPJgP2IEjIJISTHVA4jwTxIbTVtxuvmcUof1XdQi9jKkgpbV2Z26odq0S42bUr1 O/sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716289494; x=1716894294; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+gr7vAJl84gyu0xY4STz8zJjU7RxY3OrpBsCUNpNH/A=; b=gNsTn0XW+Q8RDk92PJTIKQjnFE7LOXwuCKUxrUveFdnirql/VfvqGL6nclbU9w87Qk jzWYH/p4G0vzTm6/+IDH8f+CjsTTcjulvimO1D36lrBdzcC0MNmH4dCNadlxZvGhXFNt zGZJGCjeqndN8okBATUHBlSZcbMhf+gtMRxQcTp8IKt5ZOnGcymuqFTIMTTpYFaHEpdM 0GYUDVV1R4hhTDy4Mk6VD5CIo60nKXg/OP7MQmfPX8xTF709TLJxeGVSZ8P6puiYnN6O ZogRzDPL4qVqO7+8wnw/yBUXA/USfIlDeDYuDtPKVzos46x7oAGAH66563Prn06mkmlT iwqQ== X-Gm-Message-State: AOJu0YwsttTe2Y6QqQgVCr1s9tUevdRNPLmnXFCcc3E8Q34luB34viKw XR8+zb/h6sd+xe95PGzPV6iUBYTQ9S7ki1VvkYSdP5wp104ACGsWfUClTqi0kMckp8zduWs6DEh pag== X-Received: by 2002:a05:6512:3a83:b0:51a:c8bb:fcf7 with SMTP id 2adb3069b0e04-5220fa7208dmr24398375e87.3.1716289493829; Tue, 21 May 2024 04:04:53 -0700 (PDT) Received: from localhost (host-114-191.parnet.fi. [77.234.114.191]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f38d8edbsm4610477e87.239.2024.05.21.04.04.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 May 2024 04:04:53 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 May 2024 14:04:53 +0300 Message-Id: <20240521110453.88641-1-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm: h264dsp: Avoid out of buffer writes when benchmarking 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: N6PHvb4+6cMr The loop filters can write before the pointer given to them; the actual test invocations correctly used an offset, while the benchmark calls were lacking an offset. Therefore, when running with benchmarking, these tests could have spurious failures. --- tests/checkasm/h264dsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c index 0cc1f32740..67b8dce53c 100644 --- a/tests/checkasm/h264dsp.c +++ b/tests/checkasm/h264dsp.c @@ -362,7 +362,7 @@ static void check_loop_filter(void) tc0[j][0], tc0[j][1], tc0[j][2], tc0[j][3]); \ fail(); \ } \ - bench_new(dst1, 32, alphas[j], betas[j], tc0[j]); \ + bench_new(dst1 + off, 32, alphas[j], betas[j], tc0[j]);\ } \ } \ } while (0) @@ -421,7 +421,7 @@ static void check_loop_filter_intra(void) j, alphas[j], betas[j]); \ fail(); \ } \ - bench_new(dst1, 32, alphas[j], betas[j]); \ + bench_new(dst1 + off, 32, alphas[j], betas[j]); \ } \ } \ } while (0)