Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173955
b: refs/heads/master
c: c4ed8c6
h: refs/heads/master
i:
  173953: 4dfab75
  173951: 008969c
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent ddad208 commit 7df89f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd1b6bbb4a54a232ae6a1e5e4a6fbe3507ed5142
refs/heads/master: c4ed8c66d79d707d89fe732ff5b97739edf1ba62
14 changes: 11 additions & 3 deletions trunk/drivers/media/video/uvc/uvc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ static int uvc_parse_format(struct uvc_device *dev,
/* Parse the frame descriptors. Only uncompressed, MJPEG and frame
* based formats have frame descriptors.
*/
while (buflen > 2 && buffer[2] == ftype) {
while (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE &&
buffer[2] == ftype) {
frame = &format->frame[format->nframes];
if (ftype != UVC_VS_FRAME_FRAME_BASED)
n = buflen > 25 ? buffer[25] : 0;
Expand Down Expand Up @@ -503,12 +504,14 @@ static int uvc_parse_format(struct uvc_device *dev,
buffer += buffer[0];
}

if (buflen > 2 && buffer[2] == UVC_VS_STILL_IMAGE_FRAME) {
if (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE &&
buffer[2] == UVC_VS_STILL_IMAGE_FRAME) {
buflen -= buffer[0];
buffer += buffer[0];
}

if (buflen > 2 && buffer[2] == UVC_VS_COLORFORMAT) {
if (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE &&
buffer[2] == UVC_VS_COLORFORMAT) {
if (buflen < 6) {
uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming "
"interface %d COLORFORMAT error\n",
Expand Down Expand Up @@ -749,6 +752,11 @@ static int uvc_parse_streaming(struct uvc_device *dev,
buffer += buffer[0];
}

if (buflen)
uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming interface "
"%d has %u bytes of trailing descriptor garbage.\n",
dev->udev->devnum, alts->desc.bInterfaceNumber, buflen);

/* Parse the alternate settings to find the maximum bandwidth. */
for (i = 0; i < intf->num_altsetting; ++i) {
struct usb_host_endpoint *ep;
Expand Down

0 comments on commit 7df89f7

Please sign in to comment.