diff options
author | Archit Taneja <archit@ti.com> | 2014-03-10 03:19:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-07 08:43:32 -0400 |
commit | 92851f1cdbd082eb993847e1c4468f7de08765bb (patch) | |
tree | 318b85ceee05775d0d0521dccf19df9ae1413221 /drivers/media | |
parent | 67fb87eec08a7705b0b8177095b1ef099a05b8c9 (diff) |
[media] v4l: ti-vpe: zero out reserved fields in try_fmt
Zero out the reserved formats in v4l2_pix_format_mplane and
v4l2_plane_pix_format members of the returned v4l2_format pointer when passed
through TRY_FMT ioctl.
This ensures that the user doesn't interpret the non-zero fields as some data
passed by the driver, and ensures compliance.
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/ti-vpe/vpe.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index dfed704ac375..f42c458aac11 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c | |||
@@ -1480,6 +1480,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f, | |||
1480 | } | 1480 | } |
1481 | } | 1481 | } |
1482 | 1482 | ||
1483 | memset(pix->reserved, 0, sizeof(pix->reserved)); | ||
1483 | for (i = 0; i < pix->num_planes; i++) { | 1484 | for (i = 0; i < pix->num_planes; i++) { |
1484 | plane_fmt = &pix->plane_fmt[i]; | 1485 | plane_fmt = &pix->plane_fmt[i]; |
1485 | depth = fmt->vpdma_fmt[i]->depth; | 1486 | depth = fmt->vpdma_fmt[i]->depth; |
@@ -1491,6 +1492,8 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f, | |||
1491 | 1492 | ||
1492 | plane_fmt->sizeimage = | 1493 | plane_fmt->sizeimage = |
1493 | (pix->height * pix->width * depth) >> 3; | 1494 | (pix->height * pix->width * depth) >> 3; |
1495 | |||
1496 | memset(plane_fmt->reserved, 0, sizeof(plane_fmt->reserved)); | ||
1494 | } | 1497 | } |
1495 | 1498 | ||
1496 | return 0; | 1499 | return 0; |