summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-jpeg
diff options
context:
space:
mode:
authorJacek Anaszewski2013-11-25 10:58:10 +0100
committerMauro Carvalho Chehab2013-12-18 09:12:32 +0100
commitcc690904247fdbb169e2544cbbbd4ebd2c05f8cb (patch)
tree5528eb98cb09974923164658f8edbee7b985457e /drivers/media/platform/s5p-jpeg
parent[media] s5p-jpeg: Fix output YUV 4:2:0 fourcc for decoder (diff)
downloadkernel-qcow2-linux-cc690904247fdbb169e2544cbbbd4ebd2c05f8cb.tar.gz
kernel-qcow2-linux-cc690904247fdbb169e2544cbbbd4ebd2c05f8cb.tar.xz
kernel-qcow2-linux-cc690904247fdbb169e2544cbbbd4ebd2c05f8cb.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. 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>
Diffstat (limited to 'drivers/media/platform/s5p-jpeg')
-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 eb06af1a40e9..c5b7d926dff8 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;