[media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 21 Jul 2014 10:50:39 +0000 (07:50 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 22 Jul 2014 03:44:43 +0000 (00:44 -0300)
commit48f2650a87ae462598cf0a3b4b34ee5f52c34869
tree0b9351791aaf5d6c93a7205d7976b11a734a0e76
parent796a2bd25b4fc3c4a1d6f04373ef2af1e12489b5
[media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt()

Regression fix:

V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and
VIDEO_OUTPUT buffer types, and not for any others. In the case of
the win format this overwrote a pointer value that is passed in from
userspace.

Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Set
it before the callback is called, just as is done for try/s_fmt, and
again afterwards in case the driver zeroed it. The latter was missing
in try/s_fmt, so add it there as well. Currently it is quite likely
that drivers clear priv (that was needed for a long time), so it makes
sense to set it twice.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-ioctl.c
This page took 0.038139 seconds and 5 git commands to generate.