Re: [PATCH] uvcvideo: check minimum border of control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mauro Carvalho Chehab wrote:
> Németh Márton wrote:
>> Check also the minimum border of a value before setting it
>> to a control value.
>>
>> See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 .
> 
> Patch didn't apply. Had you generated against our -git tree?
> 	http://git.linuxtv.org/v4l-dvb.git

No, this is against http://git.linuxtv.org/pinchartl/uvcvideo.git .
The latest patch which tried to fix http://bugzilla.kernel.org/show_bug.cgi?id=12824
missed to check the minimum border.

Regards,

	Márton Németh

>> Signed-off-by: Márton Németh <nm127@xxxxxxxxxxx>
>> ---
>>  drivers/media/video/uvc/uvc_ctrl.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
>> --- a/drivers/media/video/uvc/uvc_ctrl.c
>> +++ b/drivers/media/video/uvc/uvc_ctrl.c
>> @@ -1068,6 +1068,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
>>  				    uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));
>>
>>  		xctrl->value = min + (xctrl->value - min + step/2) / step * step;
>> +		if (xctrl->value < min)
>> +			xctrl->value = min;
>>  		if (xctrl->value > max)
>>  			xctrl->value = max;
>>  		value = xctrl->value;
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux