From patchwork Sun Nov 20 17:06:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 39358 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1650006pzb; Sun, 20 Nov 2022 09:06:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fCb0/vp13mOhzARYfCplxcqL4IUdtA3v1SeSHq6ZskM82a3vNUjME+L7jahq0xp3ekRI2 X-Received: by 2002:a05:6402:34d2:b0:468:37d5:9c6e with SMTP id w18-20020a05640234d200b0046837d59c6emr2315083edc.344.1668963992928; Sun, 20 Nov 2022 09:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668963992; cv=none; d=google.com; s=arc-20160816; b=rvY87yRNNfhYP1fF/96x1IM0wPFBUigsb8cJG2J64UP+lU2/AqJksBpKn982HFYb+I wGPOntZf18IM09hpg/rtJsVPSmLnxRq4bIucQw3/Koye1Fp8b5CnfwH4bqqrS7ocHvdO iLjfjZedesG5ZORcazQwy/2PAb9D/MKF0sraC0h9AuhFUVUPSZGfiLtikB6a2sxVjb/o u5tuUZRs8TOuTiji3TN1QJMSNpIK4fLy8oMzSSEqQl40Xyp42Ixm7IjVw4FP7Bq7crnH FKvBJl783WwhSGSwbfxB/RuwENjDDGUirbEu6eusDXq0GXfhR1lBSfYcPsMkrfv79cgJ kyTQ== 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=Zn4OTtEOEYPMFyvwAUC8rVaDN1omAJSKGOaRQYbz7UU=; b=a46LMP8CVjMmDfXwEFJtKNmQsufJUnNnQJZCAGL1Hco/sWZSJNOhfSsxw4NwCVU4oj 7O4T4nXCnkcle5lJ/EeBDa/0wrVo9CyMddGJqQlBZbowxZcLvXR9iIpX4AK5nIAowTeQ ogEKoDsofL4WVDpOzdJVP19BaOlvoiBiCinMDAnAJTDrG9/7+zniqp+84/SVuIItkOjR TG0eCUD9bwtNfCfzELwDesCVTSZIVHN3mPmBw0sarYnwjk90MYvJPpgMwA9F94mE9lDg nIYxOk8ODPhN3KDyFRLKAHHsuHwh9NVT0ZlV6UKkcyZBg8Ri5uO88CHPsIa6gF6ufX9y DG+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=qKQmN0SB; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x15-20020a056402414f00b0044e987f3a34si7204959eda.489.2022.11.20.09.06.32; Sun, 20 Nov 2022 09:06:32 -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=@gmail.com header.s=20210112 header.b=qKQmN0SB; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 246AD68BB0D; Sun, 20 Nov 2022 19:06:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E245268AE25 for ; Sun, 20 Nov 2022 19:06:21 +0200 (EET) Received: by mail-oi1-f169.google.com with SMTP id h132so10466636oif.2 for ; Sun, 20 Nov 2022 09:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=KXzkUlLWe2VBb85AprG1GKK3D2GOjbqk0/F+AEum1Xk=; b=qKQmN0SBE2VAESlHxjTdzxxkoHYMNx8nkz/fG5yFNVYyfPBFNPwkG1G6CYiV8sGXRd 6XwQOITPKtDp1QeOUezFuPY4/flfINL0zK1e+/2gxYl1NHlvBa3yCf93O+JXMi8Vt3NJ zrFxscdzt7JLg/BMPmHrAm9rFths5ae10XQrq6gEzsmxNYaRwxQuVfkNxjNbRGWs5cV8 Gi8c+9We5Hc6QfQWBS1O31hRsCemKwRHYR5wM4f4xndPp1ncV+UUauUg1EihGNO2m6eB pGx40XTzCsphmBzsUZ0O805qslElOa/ZyKpqB1+NQrtJ68I1pJi3R0FBgB4JCAdB/D8u IicQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=KXzkUlLWe2VBb85AprG1GKK3D2GOjbqk0/F+AEum1Xk=; b=TH+G1oxwjiRGolvHg549eCrUZEaMbZXArllqYKDYaAL6cJ/6xxB5E67pNhrlpmXMak rJ8uJy1pHk+iSIFQ8acQ0qsda12NYaSIpOSIXerbbahBwlaDMj11fVOu2MB89zSFygKs PJCYwywKMwQKR1C5XETB/DZGX6ixMyfoZRmTGYhICi7f/aYcbOkvHzLFTjK7pWf+BNZj eAUoB7fjT9b5RyBpuPjuwsS8ezUhf6drKNjc6ntTd+8lyp/eV+CbF0EY3LfcNyofKlth 8hbpYkL0xFPjHYQfvZlTuok7fIH53cKZ8s6yrLUwcahfafkicva5bNLWoohR989TUNXX 7aKw== X-Gm-Message-State: ANoB5pmWx9kkg8Xi5SV2Yo7CIyKszcfUT9efsOYLJYKb4sxb26Bu4fAS I/rmmDHqfN72bF8iANYHAzbnZUus4aE= X-Received: by 2002:a05:6808:20a5:b0:350:2873:e06 with SMTP id s37-20020a05680820a500b0035028730e06mr2644255oiw.24.1668963979742; Sun, 20 Nov 2022 09:06:19 -0800 (PST) Received: from localhost.localdomain ([181.85.72.69]) by smtp.gmail.com with ESMTPSA id a13-20020a05687073cd00b00127fbb7afffsm4871040oan.5.2022.11.20.09.06.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 09:06:18 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 20 Nov 2022 14:06:25 -0300 Message-Id: <20221120170625.3578-1-jamrial@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/framepool: use aligned height when allocating plane buffers 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: AtV/QImJUwos Fixes tickets #10051 and #10052. Signed-off-by: James Almer --- libavfilter/framepool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c index 0404589055..7e830c5a3b 100644 --- a/libavfilter/framepool.c +++ b/libavfilter/framepool.c @@ -91,15 +91,13 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), linesizes[i] = pool->linesize[i]; if (av_image_fill_plane_sizes(sizes, pool->format, - pool->height, + FFALIGN(pool->height, align), linesizes) < 0) { goto fail; } for (i = 0; i < 4 && sizes[i]; i++) { - if (sizes[i] > SIZE_MAX - align) - goto fail; - pool->pools[i] = av_buffer_pool_init(sizes[i] + align, alloc); + pool->pools[i] = av_buffer_pool_init(sizes[i], alloc); if (!pool->pools[i]) goto fail; }