Skip to content

Commit

Permalink
V4L/DVB (11948): uvcvideo: Ignore non-UVC trailing interface descript…
Browse files Browse the repository at this point in the history
…ors.

Herton Ronaldo Krzesinski from Mandriva reported that one Bison Electronics
webcam exposes a non-UVC interface descriptor. Instead of failing completely,
ignore trailing non-UVC descriptors and move on.

Thanks to Herton for reporting the problem and submitting a patch proposal.

Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Jun 16, 2009
1 parent ca4a345 commit 3b27740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/uvc/uvc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
_buflen = buflen;

/* Count the format and frame descriptors. */
while (_buflen > 2) {
while (_buflen > 2 && _buffer[1] == CS_INTERFACE) {
switch (_buffer[2]) {
case VS_FORMAT_UNCOMPRESSED:
case VS_FORMAT_MJPEG:
Expand Down Expand Up @@ -709,7 +709,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
streaming->nformats = nformats;

/* Parse the format descriptors. */
while (buflen > 2) {
while (buflen > 2 && buffer[1] == CS_INTERFACE) {
switch (buffer[2]) {
case VS_FORMAT_UNCOMPRESSED:
case VS_FORMAT_MJPEG:
Expand Down

0 comments on commit 3b27740

Please sign in to comment.