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 BA01C40285 for ; Sun, 20 Feb 2022 17:03:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3268E68AFC2; Sun, 20 Feb 2022 19:03:26 +0200 (EET) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D19468AF91 for ; Sun, 20 Feb 2022 19:03:19 +0200 (EET) Received: by mail-ot1-f41.google.com with SMTP id l25-20020a9d7a99000000b005af173a2875so1346808otn.2 for ; Sun, 20 Feb 2022 09:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=bnd3/hoEkqjgVffo5l0/LsERfKULtmF1DycSdb6twv4=; b=Nb5w+uBvn6cM657w60hNWzh0WEvuLEI5qRGswmbKuMSHehm6e4A6geXurob06Cjkcp PcWNiMqmb7nt0L4X2pilxCM12mbJtQwQiUxxZ6vOp9GK3JV/T6B/ovCrinItRNM54Oau N4KKIHCAc+9N+aG9iq3YIrUPe/Yn+gErNiM8MKM7SVnGtCKUxnMReiiZP/cod5eZ16Ui XxTJwfMD0Pg22BVk4s2a3blVDVfPZs700FtE9k+LFYkGxK1+3vv5rkHRHqNXc1vPFXo9 x+nR4GSK+POx3u+rnNa9R8F3ROCP+cii6T5iL1Lijof+fbVsFWjcvsnjrCZdVlBelXgU tjzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=bnd3/hoEkqjgVffo5l0/LsERfKULtmF1DycSdb6twv4=; b=R9qAa1xpY50te95F+4XtHluDrlDPv9x74JRqnqX1VWp47MEzY6U2NU/409kCTugryM 4wwjVYurNtBzfTpam79x1UJYCQXNatrsWaH+CJsD379eBU4GIfoHvLXjCLguQ3gLgydy SQRjoCFIS7P1MjR2LAcQV8CZKayaFyn7cDkn8RNQDa/XQbrGXKKvb4FZ6T2G58CAhb5I HPoA9ytDYyRDqG/YUDMjXLEo2Xq9KR/oFUtHXViaWC0lFpS6wphoKw9mzsRDBPfMJRBo npqVoOEuCwGbkzekYdwuOk5IjyLEHOua9c7rJMTTWyl3KBI7x7xLpZALxgokfF6F0DcO tL4Q== X-Gm-Message-State: AOAM532S8IrWZt99hKoxGtsYKmWUtQj5ereo3DRFlBIMqDK0QiH3xGfg fRb6gHH+txDQVc08uhN0NnkPiQu2F+I= X-Google-Smtp-Source: ABdhPJxGy3Fkt5kf1vhP4pS5n31i6mQiDENLLQNeNqbZ8Ny1M0EwnM/PHoiP4C+lAfUKtWgGvHnAuw== X-Received: by 2002:a05:6830:59:b0:5a6:1656:5380 with SMTP id d25-20020a056830005900b005a616565380mr5623464otp.244.1645376596886; Sun, 20 Feb 2022 09:03:16 -0800 (PST) Received: from [192.168.1.55] ([181.23.91.215]) by smtp.gmail.com with ESMTPSA id 32sm4488602ott.29.2022.02.20.09.03.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Feb 2022 09:03:16 -0800 (PST) Message-ID: Date: Sun, 20 Feb 2022 14:03:14 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220218104605.105011-1-onemda@gmail.com> <164537370230.19727.16075366139142898549@lain.red.khirnov.net> From: James Almer In-Reply-To: <164537370230.19727.16075366139142898549@lain.red.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH] avfilter/framepool: fix adjustment that can crash filtering 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2/20/2022 1:15 PM, Anton Khirnov wrote: > Quoting Paul B Mahol (2022-02-18 11:46:05) >> Fixes #9551. >> >> Signed-off-by: Paul B Mahol >> --- >> libavfilter/framepool.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c >> index 7c63807df3..aab408d355 100644 >> --- a/libavfilter/framepool.c >> +++ b/libavfilter/framepool.c >> @@ -96,7 +96,7 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), >> if (i == 1 || i == 2) >> h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h); >> >> - pool->pools[i] = av_buffer_pool_init(pool->linesize[i] * h + 16 + 16 - 1, >> + pool->pools[i] = av_buffer_pool_init(pool->linesize[i] * h + 16 + 16 - 0, >> alloc); > > all these magic constants are extremely non-obvious, why are they there > and why does removing that 1 crash anything? They are probably cargo culting from lavu's av_frame_get_buffer() and in turn from lavc's avcodec_default_get_buffer2(). In the latter, the padding is 16 + STRIDE_ALIGN - 1, where STRIDE_ALIGN is the size of the highest simd register enabled at configure time (16 for sse/neon/altivec, 32 for avx, 64 for avx512). In the former, the padding is 16 + 16 - 1, with a comment in one of those 16 that it's meant to be STRIDE_ALIGN, a lavc internal define, which means it's outdated and out of sync. What the first 16 or the -1 are, i have no idea. _______________________________________________ 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".