diff options
author | Jason Chen <b02280@freescale.com> | 2011-11-10 09:42:12 +0800 |
---|---|---|
committer | Jason Chen <b02280@freescale.com> | 2011-11-16 16:32:05 +0800 |
commit | 912eb564ab1b233944d5a82256b99645d8cc9f43 (patch) | |
tree | e8488456d7ee846e3230da2f06b3737673e1b31e /drivers/media/video/mxc/output/mxc_vout.c | |
parent | 8541a280f40cdafcd83a913697553f6d0c0206a8 (diff) |
ENGR00161845 mxc v4l2 output: add check of S_CROP width and height
To avoid CROP width=0 or height=0 case.
Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers/media/video/mxc/output/mxc_vout.c')
-rw-r--r-- | drivers/media/video/mxc/output/mxc_vout.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c index 58e60eba814..81056b5b1db 100644 --- a/drivers/media/video/mxc/output/mxc_vout.c +++ b/drivers/media/video/mxc/output/mxc_vout.c @@ -910,6 +910,11 @@ static int mxc_vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop if (vout->vbq.streaming) return -EBUSY; + if (crop->c.width == 0) + crop->c.width = b->width - b->left; + if (crop->c.height == 0) + crop->c.height = b->height - b->top; + if (crop->c.top < b->top) crop->c.top = b->top; if (crop->c.top >= b->top + b->height) |