From patchwork Fri Jun 17 08:34:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Pantelic X-Patchwork-Id: 890862 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5H8Z5RA002607 for ; Fri, 17 Jun 2011 08:35:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757153Ab1FQIes (ORCPT ); Fri, 17 Jun 2011 04:34:48 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:54801 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755887Ab1FQIer (ORCPT ); Fri, 17 Jun 2011 04:34:47 -0400 Received: by fxm17 with SMTP id 17so1599482fxm.19 for ; Fri, 17 Jun 2011 01:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type; bh=X/Lp4/3gfv1dcmSiQE7WevhyQQwlqGMZPZX27IOcy3U=; b=xK1X3uWLoNZ9u647mD3uIPRLDQOANlh4DSbGkczRI3WRWzT8V5jod3XBJ4lAwb45ch MeABd6G/wjPvTnn2SctRrU1akPwz72ANul3f7hKRZlttsqVRfizH4vNELvOWzDJvnZyQ FZW6aaAmmm8DrmxndZu+oD3WSiFOqEdlvEPwA= 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; b=rE0YJStG84DQkIN90p0EbTIBZvabnORmi/Nn3FVCX/Ht8gxj1bRj0Bdtfcx8IkeP2J c5nzi9Fg/OpXp0QmJdGDBlHYJRS6uFbu4DHgzyzPacqgBJ85p5c9Cwxodk2IIdLhv0yF 1ZBPt3IgU9l0Emo37HRpBG2X76u3UO5sADVWY= Received: by 10.223.55.201 with SMTP id v9mr723850fag.76.1308299686029; Fri, 17 Jun 2011 01:34:46 -0700 (PDT) Received: from [192.168.1.22] (p50996ded.dip0.t-ipconnect.de [80.153.109.237]) by mx.google.com with ESMTPS id g8sm1209601fai.20.2011.06.17.01.34.45 (version=SSLv3 cipher=OTHER); Fri, 17 Jun 2011 01:34:45 -0700 (PDT) Message-ID: <4DFB11A4.1040202@gmail.com> Date: Fri, 17 Jun 2011 10:34:44 +0200 From: Vladimir Pantelic User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20110511 Firefox/4.0.1 SeaMonkey/2.1 MIME-Version: 1.0 To: Kernel development list , "linux-omap@vger.kernel.org" , "Hiremath, Vaibhav" Subject: [PATCH v2] omap v4l2: fix wrong resizer calculation Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Jun 2011 08:35:06 +0000 (UTC) changes since v1: reworded the commit message as requested From f7f1c11fef76e53cdfe4ad98c6c9605dbe94aa86 Mon Sep 17 00:00:00 2001 From: Vladimir Pantelic Date: Tue, 26 Apr 2011 09:28:11 +0200 Subject: [PATCH] omap v4l2: fix wrong resizer calculation The omap_vout_new_crop() function has a possible bug, it uses uninitialized variables "crop.width/height" which are actually output of the function. Instead we should be using "try_crop.width/height" to calculate the resizer values. Signed-off-by: Vladimir Pantelic Acked-by: Hiremath, Vaibhav --- drivers/media/video/omap/omap_voutlib.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/omap/omap_voutlib.c b/drivers/media/video/omap/omap_voutlib.c index 2aa6a76..8ae7481 100644 --- a/drivers/media/video/omap/omap_voutlib.c +++ b/drivers/media/video/omap/omap_voutlib.c @@ -193,7 +193,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, return -EINVAL; if (cpu_is_omap24xx()) { - if (crop->height != win->w.height) { + if (try_crop.height != win->w.height) { /* If we're resizing vertically, we can't support a * crop width wider than 768 pixels. */ @@ -202,7 +202,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, } } /* vertical resizing */ - vresize = (1024 * crop->height) / win->w.height; + vresize = (1024 * try_crop.height) / win->w.height; if (cpu_is_omap24xx() && (vresize > 2048)) vresize = 2048; else if (cpu_is_omap34xx() && (vresize > 4096)) @@ -221,7 +221,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, try_crop.height = 2; } /* horizontal resizing */ - hresize = (1024 * crop->width) / win->w.width; + hresize = (1024 * try_crop.width) / win->w.width; if (cpu_is_omap24xx() && (hresize > 2048)) hresize = 2048; else if (cpu_is_omap34xx() && (hresize > 4096)) -- 1.7.6.rc1.1.g2c162b