aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Pantelic <vladoman@gmail.com>2011-04-26 03:28:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-01 14:46:24 -0400
commite8bb10b82f3d9fff79751ee392c1c499e3d68365 (patch)
tree260548d8442699f3138b90f619361d37672dd99f
parentaa122d424b14b4a4c5ba302e668366717e9cac7b (diff)
[media] OMAP_VOUTLIB: Fix wrong resizer calculation
The omap_vout_new_crop() function has possible bug, uses uninitialized variable "crop.width/height" which is actually output of the function. Instead we should be using "try_crop.width/height" to calculate the resizer value. Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/omap/omap_voutlib.c6
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 2aa6a76c5e59..8ae74817a110 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,
193 return -EINVAL; 193 return -EINVAL;
194 194
195 if (cpu_is_omap24xx()) { 195 if (cpu_is_omap24xx()) {
196 if (crop->height != win->w.height) { 196 if (try_crop.height != win->w.height) {
197 /* If we're resizing vertically, we can't support a 197 /* If we're resizing vertically, we can't support a
198 * crop width wider than 768 pixels. 198 * crop width wider than 768 pixels.
199 */ 199 */
@@ -202,7 +202,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
202 } 202 }
203 } 203 }
204 /* vertical resizing */ 204 /* vertical resizing */
205 vresize = (1024 * crop->height) / win->w.height; 205 vresize = (1024 * try_crop.height) / win->w.height;
206 if (cpu_is_omap24xx() && (vresize > 2048)) 206 if (cpu_is_omap24xx() && (vresize > 2048))
207 vresize = 2048; 207 vresize = 2048;
208 else if (cpu_is_omap34xx() && (vresize > 4096)) 208 else if (cpu_is_omap34xx() && (vresize > 4096))
@@ -221,7 +221,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
221 try_crop.height = 2; 221 try_crop.height = 2;
222 } 222 }
223 /* horizontal resizing */ 223 /* horizontal resizing */
224 hresize = (1024 * crop->width) / win->w.width; 224 hresize = (1024 * try_crop.width) / win->w.width;
225 if (cpu_is_omap24xx() && (hresize > 2048)) 225 if (cpu_is_omap24xx() && (hresize > 2048))
226 hresize = 2048; 226 hresize = 2048;
227 else if (cpu_is_omap34xx() && (hresize > 4096)) 227 else if (cpu_is_omap34xx() && (hresize > 4096))