From patchwork Mon Oct 26 11:24:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 55855 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9QBE79m017753 for ; Mon, 26 Oct 2009 11:14:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755601AbZJZLOB (ORCPT ); Mon, 26 Oct 2009 07:14:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755602AbZJZLOB (ORCPT ); Mon, 26 Oct 2009 07:14:01 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]:35033 "EHLO mail-ew0-f208.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755598AbZJZLOA (ORCPT ); Mon, 26 Oct 2009 07:14:00 -0400 Received: by ewy4 with SMTP id 4so3470101ewy.37 for ; Mon, 26 Oct 2009 04:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=wgkpO7qkNkvc62rV1hfhzHvgnoAgREag5J3mYElBGEQ=; b=IBglPJEay9JnG08p3mKY+WGiibQ84EQlyTK89Bn5oLiHoc1oPVJcaElcUdoIaoYITc FQ/bWmvwBI4yU7pVaDylYMfu5vsEEHqcuPMHsjV3W8JPdGjPgv0JRZ1TeI6Kkt1koa45 iZ72bHLrPErOb/obEIKVAdLaEc5NWbkVU89Ls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=vcUYQ0WBE8Wp9+CAiutmshgg+tq/UZ7+AbVUDxa3J576Hf/Hs/49LAjGLO9AJUyorW uqaOhDDBAxOCLjRWT5hcj2CLNQDy+Cc0HI/w1uRNGDyH6imby8odGqIiqeDEGmEs8Vte vzSsPaaeBuXYm4MZxoy3jYrc/tUWmylQUmKhc= Received: by 10.210.101.14 with SMTP id y14mr4237976ebb.95.1256555644476; Mon, 26 Oct 2009 04:14:04 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm1240860eyb.8.2009.10.26.04.14.03 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 04:14:03 -0700 (PDT) Message-ID: <4AE586F2.9060501@gmail.com> Date: Mon, 26 Oct 2009 12:24:34 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, Andrew Morton , m-karicheri2@ti.com Subject: [PATCH] V4L/DVB: keep index within bound in vpfe_cropcap() Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index 402ce43..6b31e59 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1577,7 +1577,7 @@ static int vpfe_cropcap(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_cropcap\n"); - if (vpfe_dev->std_index > ARRAY_SIZE(vpfe_standards)) + if (vpfe_dev->std_index >= ARRAY_SIZE(vpfe_standards)) return -EINVAL; memset(crop, 0, sizeof(struct v4l2_cropcap));