From patchwork Wed Nov 8 18:17:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 5959 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1072300jah; Wed, 8 Nov 2017 10:19:23 -0800 (PST) X-Google-Smtp-Source: ABhQp+S0NA6t8QHQ/jVXB6flTn3ZAuQ5tnZ+NiR6HL3TCuKA9VeaXEXvXrlva79gxryZkMA+S9Tq X-Received: by 10.223.199.138 with SMTP id l10mr1153188wrg.121.1510165163489; Wed, 08 Nov 2017 10:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510165163; cv=none; d=google.com; s=arc-20160816; b=xwrthov6zaEZb/98YrpeqMjsMNg1Tv0yMe/dZDeKSJH5SCZDT28uGVquWHxV+Q9w9z hGmgAaHLuPIiPsBtoSbuz0Rwn8sSNJJRb5anhYh/3i/KBQeTxeyGbtz33To9EwQgclss 5JzyOUPizSWglV0YvD1+xDB0whFXAJ7gfs1hA/XVPGS7sa+QK05tZxVFL2Q8JT+9E7P7 /8eOY0Z7OCn40a4zRef7MdcnFgzuv4WUPz7H8sgEZbAUtUaxw6XR0HJ+Roy7z8HeeFG8 uwZmu0sMP4quQENLGbXQRjlT1vjgbvOEAOaE6Xcn2qdtwXNTpECSalxIdwxcV69LRj7g 8hAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=UYfxDRWD5uftIvMjelrHqBBFBduH0UttpzkwlRSmwRo=; b=e2dYEo6VKszUaxf3epqNn5jUKBmDAl6cKlXp7xYN0ewR+p0BSILfZ7rJ+7Jh5gt8ul aiNij0mdOq5Jr2bYNMI51n2ecJwwcFQcPXPHqDOqEmEp9LKF9LLCNLAyTq8KOy7KOipw QkdJr+KKNew7knOw05jLlLjwtexTQ3+QvN37o0mDgHHp3IV8MEDIzgLsAt7zG8HCXuyX Ev+hp7hEOvK9rM2RPVKvzUx6gvpGR/lvdzqWHAvvvklROZMrfJ802dQIPW6jqPcgZJAj QMr7t7G0Qv8QLFQWYXqMqAEIhH7DUoQ/iYnYgie5nmRzGODhNjjKhjT2/zbVi3+BQg4i Ds0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=R4TtnLo3; 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 d26si4794043wrc.272.2017.11.08.10.19.23; Wed, 08 Nov 2017 10:19:23 -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=@rothenpieler.org header.s=mail header.b=R4TtnLo3; 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 2CCCB689EB0; Wed, 8 Nov 2017 20:18:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7535C689E67 for ; Wed, 8 Nov 2017 20:18:01 +0200 (EET) Received: from localhost.localdomain (ip4d15a587.dynamic.kabel-deutschland.de [77.21.165.135]) by btbn.de (Postfix) with ESMTPSA id AF6EF11163E; Wed, 8 Nov 2017 19:18:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1510165089; bh=Pp2PEr7I/dbLdWGn8CpN5CiePpK/n8BVgHjqeCwEU2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R4TtnLo3FNp1h2YbSWw9yMZafLK7/bM9RLzyUIUiiHJupFibzCz3XXkho2kv2iioN w6P8byYByh+z91vV7xBwrju+6hkHBTM4MFFAUd63XtEJQ0HaxF676T+5xF+IsHiulX lxcm0HQD3Q21gis9yvAp1bf/QkxwKQSRihmlJ+sw= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Wed, 8 Nov 2017 19:17:50 +0100 Message-Id: <20171108181753.6776-7-timo@rothenpieler.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171108181753.6776-1-timo@rothenpieler.org> References: <20171108181753.6776-1-timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 6/9] avfilter/vf_premultiply: make sure plane count is less than 4 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes CID #1416350, #1416351, #1416353 and #1416354 --- libavfilter/vf_premultiply.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c index 5120adc476..1af6433bc9 100644 --- a/libavfilter/vf_premultiply.c +++ b/libavfilter/vf_premultiply.c @@ -476,7 +476,7 @@ static int filter_frame(AVFilterContext *ctx, } } - for (p = 0; p < s->nb_planes; p++) { + for (p = 0; p < s->nb_planes && p < 4; p++) { if (!((1 << p) & s->planes) || p == 3) { av_image_copy_plane((*out)->data[p], (*out)->linesize[p], base->data[p], base->linesize[p], s->linesize[p], s->height[p]); @@ -523,6 +523,8 @@ static int config_input(AVFilterLink *inlink) int vsub, hsub, ret; s->nb_planes = av_pix_fmt_count_planes(inlink->format); + if (s->nb_planes > 4) + return AVERROR_BUG; if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0) return ret;