From patchwork Tue Feb 26 17:36:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10830671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45E6B13B5 for ; Tue, 26 Feb 2019 17:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30D5D2D1B6 for ; Tue, 26 Feb 2019 17:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 241A82D1B8; Tue, 26 Feb 2019 17:37:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7A132D188 for ; Tue, 26 Feb 2019 17:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727823AbfBZRhA (ORCPT ); Tue, 26 Feb 2019 12:37:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60662 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727629AbfBZRhA (ORCPT ); Tue, 26 Feb 2019 12:37:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ldC5jaNZeBLuT4TFhUSrB1oh58ptpjmDDrx5uKHOP+c=; b=XPe29h3ybG2lXBXyo7SMEInb2k 2qY9vnRWFwMmYbbtYbsZyrGSa3LZEAYgh2LEYj9yzrPEnFbO4x5xv60Ua2XdY0k4q3lCwt2VeKBmd CDmUWqx/2ZMPZOAcSAretFYq9A8dMYvplQLkxgv7K/nk5JSJ7rkWIxq4ufmqrZ1zK+Y4o8SfwfKyI Yx76zKRZ0RczoSPpXNUHOX1qgT2sKQiYzyZVl5ML1QX6dbBFgu59ea1Mhe3SyqOENof0LS3BnRS18 UrARamIlUjprzeF40b3mo7k1+UYkIkSwvRf/BgASdvT9yLHrbbwikh+56zF3otj3ActKI95SMQXLI Rd17hGTA==; Received: from 177.41.100.217.dynamic.adsl.gvt.net.br ([177.41.100.217] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gygf5-0006Oi-J0; Tue, 26 Feb 2019 17:36:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1gygf2-0002Nx-PY; Tue, 26 Feb 2019 14:36:56 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil , Ezequiel Garcia Subject: [PATCH 2/2] media: vim2m: ensure that width is multiple of two Date: Tue, 26 Feb 2019 14:36:55 -0300 Message-Id: <0a47c5ad8099c5988e961d44221b4a95d74f8322.1551202610.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <627b2c823606801a9d2cf0bb2ea15ad83942e6dd.1551202610.git.mchehab+samsung@kernel.org> References: <627b2c823606801a9d2cf0bb2ea15ad83942e6dd.1551202610.git.mchehab+samsung@kernel.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The copy logic assumes that the data width is multiple of two, as this is needed in order to support YUYV. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/vim2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index ab288e8377f1..89384f324e25 100644 --- a/drivers/media/platform/vim2m.c +++ b/drivers/media/platform/vim2m.c @@ -801,7 +801,7 @@ static int vidioc_s_fmt(struct vim2m_ctx *ctx, struct v4l2_format *f) } q_data->fmt = find_format(f); - q_data->width = f->fmt.pix.width; + q_data->width = f->fmt.pix.width & (~1); q_data->height = f->fmt.pix.height; q_data->sizeimage = q_data->width * q_data->height * q_data->fmt->depth >> 3;