diff options
author | Jason Chen <b02280@freescale.com> | 2011-11-10 09:42:12 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2011-12-19 11:25:17 +0800 |
commit | a93a3389a511f765bddfbd18265a2793a929f3aa (patch) | |
tree | 07ac581870ad1c9bdd0e39521ef1a022abc247a1 | |
parent | edaa7648d61c18f17469ac874ec2a776118365cf (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>
-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) |