diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2015-03-15 14:30:25 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 23:54:47 -0300 |
commit | cc7d2dfb75b3ac0f248801ceed65f69465eb0389 (patch) | |
tree | 91e777bc40f151634eb0570dd2d28adb67165fa7 /include | |
parent | 03c278f01d70ce168a24f85a08e11636df30f580 (diff) | |
download | linux-stable-cc7d2dfb75b3ac0f248801ceed65f69465eb0389.tar.gz linux-stable-cc7d2dfb75b3ac0f248801ceed65f69465eb0389.tar.bz2 linux-stable-cc7d2dfb75b3ac0f248801ceed65f69465eb0389.zip |
[media] v4l2_plane_pix_format: use __u32 bytesperline instead of __u16
While running v4l2-compliance tests on vivid I suddenly got errors due to
a call to vmalloc_user with size 0 from vb2.
Digging deeper into the cause I discovered that this was due to the fact that
struct v4l2_plane_pix_format defines bytesperline as a __u16 instead of a __u32.
The test I was running selected a format of 4 * 4096 by 4 * 2048 with a 32
bit pixelformat.
So bytesperline was 4 * 4 * 4096 = 65536, which becomes 0 in a __u16. And
bytesperline * height is suddenly 0 as well. While the vivid driver may be
a virtual driver, it is to be expected that this limit will be hit for real
hardware as well in the near future: 8k deep-color video will already reach
it.
The solution is to change the type to __u32. The only drivers besides vivid
that use the multiplanar API are little-endian ARM and SH platforms (exynos,
ti-vpe, vsp1), so this is safe.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/videodev2.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 15b21e481246..47df18f36c4b 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1842,8 +1842,8 @@ struct v4l2_mpeg_vbi_fmt_ivtv { */ struct v4l2_plane_pix_format { __u32 sizeimage; - __u16 bytesperline; - __u16 reserved[7]; + __u32 bytesperline; + __u16 reserved[6]; } __attribute__ ((packed)); /** |