Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp674741pxb; Thu, 31 Mar 2022 14:39:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweOUcjHqqK9GkYJkfRofn8O2pWGZgIv3sSCJhKfgokfe9ZAHf4gdWdiIXJNpZ0nC0JTkTR X-Received: by 2002:a05:6402:516c:b0:419:92c:a2a with SMTP id d12-20020a056402516c00b00419092c0a2amr18418620ede.175.1648762764926; Thu, 31 Mar 2022 14:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648762764; cv=none; d=google.com; s=arc-20160816; b=ovIDYM51GlQ6gadyoR0/fmS3D3eb9a6M3qXBs0D3cVGeY1wNdMB4O7cve9rM0dgTSh LAeUmLHNCQF9RSsyqf9JDwG4uNLAuO/zycx6DkhvtkIEQnjJ09ZboL0Jmlcwuji1bvOP usvREdohlKO54/apxNqy30xFK0/6dVzZJpC0iYnoey+A+E/0jOUGBVy5Kil75lqFbEx3 TjUTwcgESH3tisV0wo5GJiBh1rFfuITGi2vHNE+FYdCkOohidxCPRyoh8zkksppjATpv SqWHtUlFAXzqnaUGs5VUwoRT1/gkQ5BM6nNoYOweqUghFzOTFVbcTzb4RN1IbzTdEd3D 7W4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DKbZjbCoLHoHcVmAtZmVgRhINmXxKWqwJW0qnNJ0UcY=; b=V5uIzv6HKw65oA15ZLmR/vRuejC/E78liMqpzpMVMIXTBi7HadTOclbDfAyqT6dmKI aAj8f2ygyX+KW29F1jt9cGPJCVUTfwNyK5VcR4g+GO+7Fcx4IfmybMdHDIbd9vXCL5P/ BFEpnKjHbU25G1DsZL5fiM8DRj42isVp6/lWMjdKHOJlOx/opnek2aNWOTY4W5+FVbj3 SQ0Vh5bg6pSjBHx7CFNlbVxqOA6WJASx9psjfPJWJk1U6/Pc5gp4f4glLbmTPItiLe7F erTdTPqqQTOuAqJ30lSqdD1vEBtrJhXkkGXVtmPolZtOa0ZY1LRl8l3QdxEh6zv7n0UG OgbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nTv+anF6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a170906b00100b006df76385e45si387954ejy.741.2022.03.31.14.38.57; Thu, 31 Mar 2022 14:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nTv+anF6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241089AbiCaTku (ORCPT + 99 others); Thu, 31 Mar 2022 15:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240982AbiCaTj4 (ORCPT ); Thu, 31 Mar 2022 15:39:56 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE0D23D46B; Thu, 31 Mar 2022 12:38:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id A94421F47263 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648755483; bh=77EXBZHZKJfw+bMSetijgv88NZsVwqAJYYAOhg0Ep10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nTv+anF6T6CZSDOWJpi/e7JMPAiQ+OiqDq+zoXcivpfWj7RiIAT/QPwgP5BPFCfv5 gsIO6FqhhxY2Ww7s8nunjbRmJ7/l517nuWJls4QZgKjjY0P/hRvGxLO/F7Te92Lst6 FWM6R7qfFqcEtMT2V1TzcnkeNbQHvtGGd35gaKbqaGQlZgehqCyFaENvVuQLvYE5RI sEx0D+LS5k7zGfAk96yg3bm//7/ufqz6jkvHRMxAezteFD/K3ZJc97vMbwMXsC2TmH awsoiK0OybnrqBRvZLR/Wbl8SNZ7MUkVd79MskUJ7f0OjxV4xGxeg/3iiPepvnZ0mG UihnBY7ifC5cQ== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: kernel@collabora.com, Jonas Karlman , Sebastian Fricke , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 18/23] media: rkvdec: Ensure decoded resolution fit coded resolution Date: Thu, 31 Mar 2022 15:37:20 -0400 Message-Id: <20220331193726.289559-19-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220331193726.289559-1-nicolas.dufresne@collabora.com> References: <20220331193726.289559-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Karlman Ensure decoded CAPTURE buffer resolution is larger or equal to the coded OUTPUT buffer resolution. Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke --- drivers/staging/media/rkvdec/rkvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index b6376eaa92d7..21b6e7dc5181 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -279,6 +279,8 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv, pix_mp->pixelformat = coded_desc->decoded_fmts[0]; /* Always apply the frmsize constraint of the coded end. */ + pix_mp->width = max(pix_mp->width, ctx->coded_fmt.fmt.pix_mp.width); + pix_mp->height = max(pix_mp->height, ctx->coded_fmt.fmt.pix_mp.height); v4l2_apply_frmsize_constraints(&pix_mp->width, &pix_mp->height, &coded_desc->frmsize); -- 2.34.1