Commit e8bb10b8 authored by Vladimir Pantelic's avatar Vladimir Pantelic Committed by Mauro Carvalho Chehab

[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: default avatarVladimir Pantelic <vladoman@gmail.com>
Signed-off-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent aa122d42
...@@ -193,7 +193,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, ...@@ -193,7 +193,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
return -EINVAL; return -EINVAL;
if (cpu_is_omap24xx()) { 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 /* If we're resizing vertically, we can't support a
* crop width wider than 768 pixels. * crop width wider than 768 pixels.
*/ */
...@@ -202,7 +202,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, ...@@ -202,7 +202,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
} }
} }
/* vertical resizing */ /* vertical resizing */
vresize = (1024 * crop->height) / win->w.height; vresize = (1024 * try_crop.height) / win->w.height;
if (cpu_is_omap24xx() && (vresize > 2048)) if (cpu_is_omap24xx() && (vresize > 2048))
vresize = 2048; vresize = 2048;
else if (cpu_is_omap34xx() && (vresize > 4096)) else if (cpu_is_omap34xx() && (vresize > 4096))
...@@ -221,7 +221,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, ...@@ -221,7 +221,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
try_crop.height = 2; try_crop.height = 2;
} }
/* horizontal resizing */ /* horizontal resizing */
hresize = (1024 * crop->width) / win->w.width; hresize = (1024 * try_crop.width) / win->w.width;
if (cpu_is_omap24xx() && (hresize > 2048)) if (cpu_is_omap24xx() && (hresize > 2048))
hresize = 2048; hresize = 2048;
else if (cpu_is_omap34xx() && (hresize > 4096)) else if (cpu_is_omap34xx() && (hresize > 4096))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment