aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran_driver.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 17:29:43 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:25 -0400
commitbb2e033913f14b2f9f6745e206c3ea5df481b4fd (patch)
tree700c014464227558914fa302a3056cfc6c779bf8 /drivers/media/video/zoran_driver.c
parente42af83f4874ebb2c6af59a05dbe5d45114fb0ed (diff)
V4L/DVB (5888): zr36067: Driver was not returning correct image size
The driver was returning the size of the (fixed) buffer it allocated as the sizeimage field in the v4l2 pixel format, rather than the actual size of the image. For example, a 192x128 YUYV image is 49152 bytes but the driver would always return 131072 bytes since if that was the size of the v4l buffer. This violates the v4l2 spec, which says that sizeimage should be the actual size of the image for uncompressed formats. It also caused mplayer to crash. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zoran_driver.c')
-rw-r--r--drivers/media/video/zoran_driver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index 37e25c25279b..06446311564a 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -2737,7 +2737,8 @@ zoran_do_ioctl (struct inode *inode,
2737 fmt->fmt.pix.height = 2737 fmt->fmt.pix.height =
2738 fh->v4l_settings.height; 2738 fh->v4l_settings.height;
2739 fmt->fmt.pix.sizeimage = 2739 fmt->fmt.pix.sizeimage =
2740 fh->v4l_buffers.buffer_size; 2740 fh->v4l_settings.bytesperline *
2741 fh->v4l_settings.height;
2741 fmt->fmt.pix.pixelformat = 2742 fmt->fmt.pix.pixelformat =
2742 fh->v4l_settings.format->fourcc; 2743 fh->v4l_settings.format->fourcc;
2743 fmt->fmt.pix.colorspace = 2744 fmt->fmt.pix.colorspace =
@@ -2984,8 +2985,9 @@ zoran_do_ioctl (struct inode *inode,
2984 2985
2985 /* tell the user the 2986 /* tell the user the
2986 * results/missing stuff */ 2987 * results/missing stuff */
2987 fmt->fmt.pix.sizeimage = fh->v4l_buffers.buffer_size /*zr->gbpl * zr->gheight */ 2988 fmt->fmt.pix.sizeimage =
2988 ; 2989 fh->v4l_settings.height *
2990 fh->v4l_settings.bytesperline;
2989 if (BUZ_MAX_HEIGHT < 2991 if (BUZ_MAX_HEIGHT <
2990 (fh->v4l_settings.height * 2)) 2992 (fh->v4l_settings.height * 2))
2991 fmt->fmt.pix.field = 2993 fmt->fmt.pix.field =