summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2013-11-25 06:58:10 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:01:09 +0900
commit4e0a8434d1acc842b528b2f163a40434d9263205 (patch)
tree9fce28ec6128a06997b9da2fc0c81d89661d5b76
parent52e7f17b4726a959d8dd8e741f174738e5503c1c (diff)
downloadlinux-3.10-4e0a8434d1acc842b528b2f163a40434d9263205.tar.gz
linux-3.10-4e0a8434d1acc842b528b2f163a40434d9263205.tar.bz2
linux-3.10-4e0a8434d1acc842b528b2f163a40434d9263205.zip
[media] s5p-jpeg: Fix erroneous condition while validating bytesperline value
The aim of the condition is ensuring that the bytesperline value set by the user space application is proper for the given format and adjusting it if isn't. As the depth value of the format description entry is expressed in bits then the bytesperline value needs to be divided, not multiplied, by that value to get the number of bytes required to store single line of image samples. Change-Id: Ied5ab2df3b4ab89d44178481a9b15c51e4d02085 Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index def4d94ccbd..d84ebdd0c15 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -670,7 +670,7 @@ static int vidioc_try_fmt(struct v4l2_format *f, struct s5p_jpeg_fmt *fmt,
bpl = pix->width; /* planar */
if (fmt->colplanes == 1 && /* packed */
- (bpl << 3) * fmt->depth < pix->width)
+ (bpl << 3) / fmt->depth < pix->width)
bpl = (pix->width * fmt->depth) >> 3;
pix->bytesperline = bpl;