aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@skynet.be>2009-06-09 12:07:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:07:32 -0400
commit3b27740c7de0fd59032c723ad326926c97383e95 (patch)
treed3235a4aba83d02926a6ffbb2c80f2b0950b220b
parentca4a3456858775081f172e89077aa65cf5dbc52a (diff)
V4L/DVB (11948): uvcvideo: Ignore non-UVC trailing interface descriptors.
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>
-rw-r--r--drivers/media/video/uvc/uvc_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index f7545126951..89927b7aec2 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -644,7 +644,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
644 _buflen = buflen; 644 _buflen = buflen;
645 645
646 /* Count the format and frame descriptors. */ 646 /* Count the format and frame descriptors. */
647 while (_buflen > 2) { 647 while (_buflen > 2 && _buffer[1] == CS_INTERFACE) {
648 switch (_buffer[2]) { 648 switch (_buffer[2]) {
649 case VS_FORMAT_UNCOMPRESSED: 649 case VS_FORMAT_UNCOMPRESSED:
650 case VS_FORMAT_MJPEG: 650 case VS_FORMAT_MJPEG:
@@ -709,7 +709,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
709 streaming->nformats = nformats; 709 streaming->nformats = nformats;
710 710
711 /* Parse the format descriptors. */ 711 /* Parse the format descriptors. */
712 while (buflen > 2) { 712 while (buflen > 2 && buffer[1] == CS_INTERFACE) {
713 switch (buffer[2]) { 713 switch (buffer[2]) {
714 case VS_FORMAT_UNCOMPRESSED: 714 case VS_FORMAT_UNCOMPRESSED:
715 case VS_FORMAT_MJPEG: 715 case VS_FORMAT_MJPEG: