diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/uvc/uvc_driver.c | 4 |
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 f75451269518..89927b7aec28 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: |