提交 3b27740c 编写于 作者: L Laurent Pinchart 提交者: Mauro Carvalho Chehab

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: NLaurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ca4a3456
...@@ -644,7 +644,7 @@ static int uvc_parse_streaming(struct uvc_device *dev, ...@@ -644,7 +644,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
_buflen = buflen; _buflen = buflen;
/* Count the format and frame descriptors. */ /* Count the format and frame descriptors. */
while (_buflen > 2) { while (_buflen > 2 && _buffer[1] == CS_INTERFACE) {
switch (_buffer[2]) { switch (_buffer[2]) {
case VS_FORMAT_UNCOMPRESSED: case VS_FORMAT_UNCOMPRESSED:
case VS_FORMAT_MJPEG: case VS_FORMAT_MJPEG:
...@@ -709,7 +709,7 @@ static int uvc_parse_streaming(struct uvc_device *dev, ...@@ -709,7 +709,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
streaming->nformats = nformats; streaming->nformats = nformats;
/* Parse the format descriptors. */ /* Parse the format descriptors. */
while (buflen > 2) { while (buflen > 2 && buffer[1] == CS_INTERFACE) {
switch (buffer[2]) { switch (buffer[2]) {
case VS_FORMAT_UNCOMPRESSED: case VS_FORMAT_UNCOMPRESSED:
case VS_FORMAT_MJPEG: case VS_FORMAT_MJPEG:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册