V4L/DVB (13504): uvcvideo: Fix extension units parsing

The bNrInPins field is an 8 bit integer, not a 16 bit integer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Laurent Pinchart 2009-11-25 12:00:27 -03:00 committed by Mauro Carvalho Chehab
parent 6241d8ca1d
commit fd3e921739
1 changed files with 2 additions and 2 deletions

View File

@ -844,7 +844,7 @@ static int uvc_parse_vendor_control(struct uvc_device *dev,
unit->type = UVC_VC_EXTENSION_UNIT; unit->type = UVC_VC_EXTENSION_UNIT;
memcpy(unit->extension.guidExtensionCode, &buffer[4], 16); memcpy(unit->extension.guidExtensionCode, &buffer[4], 16);
unit->extension.bNumControls = buffer[20]; unit->extension.bNumControls = buffer[20];
unit->extension.bNrInPins = get_unaligned_le16(&buffer[21]); unit->extension.bNrInPins = buffer[21];
unit->extension.baSourceID = (__u8 *)unit + sizeof *unit; unit->extension.baSourceID = (__u8 *)unit + sizeof *unit;
memcpy(unit->extension.baSourceID, &buffer[22], p); memcpy(unit->extension.baSourceID, &buffer[22], p);
unit->extension.bControlSize = buffer[22+p]; unit->extension.bControlSize = buffer[22+p];
@ -1108,7 +1108,7 @@ static int uvc_parse_standard_control(struct uvc_device *dev,
unit->type = buffer[2]; unit->type = buffer[2];
memcpy(unit->extension.guidExtensionCode, &buffer[4], 16); memcpy(unit->extension.guidExtensionCode, &buffer[4], 16);
unit->extension.bNumControls = buffer[20]; unit->extension.bNumControls = buffer[20];
unit->extension.bNrInPins = get_unaligned_le16(&buffer[21]); unit->extension.bNrInPins = buffer[21];
unit->extension.baSourceID = (__u8 *)unit + sizeof *unit; unit->extension.baSourceID = (__u8 *)unit + sizeof *unit;
memcpy(unit->extension.baSourceID, &buffer[22], p); memcpy(unit->extension.baSourceID, &buffer[22], p);
unit->extension.bControlSize = buffer[22+p]; unit->extension.bControlSize = buffer[22+p];