From f6b49c218844c7d0df8010f6745358f5889b52d6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 3 Aug 2006 09:35:24 -0300 Subject: Fix V4L1 Compat for VIDIOCGPICT ioctl From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/v4l1-compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux') diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c index decf7069b..dc6f00e12 100644 --- a/linux/drivers/media/video/v4l1-compat.c +++ b/linux/drivers/media/video/v4l1-compat.c @@ -612,7 +612,9 @@ v4l_compat_translate_ioctl(struct inode *inode, break; } - pict->depth = (fmt2->fmt.pix.bytesperline/fmt2->fmt.pix.width) << 3; + pict->depth = ((fmt2->fmt.pix.bytesperline<<3) + + (fmt2->fmt.pix.width-1) ) + /fmt2->fmt.pix.width; pict->palette = pixelformat_to_palette( fmt2->fmt.pix.pixelformat); break; -- cgit v1.2.3