usb: fixed potential crash.

* The active interface may be null. This actually happens with a Lasmex
  USB speaker in case it is turned on.
This commit is contained in:
Axel Dörfler 2014-05-22 18:34:23 +02:00
parent 1152f83ddc
commit 59750213e7

View File

@ -465,6 +465,9 @@ Device::InitEndpoints(int32 interfaceIndex)
usb_interface_info* interfaceInfo
= fCurrentConfiguration->interface[j].active;
if (interfaceInfo == NULL)
continue;
for (size_t i = 0; i < interfaceInfo->endpoint_count; i++) {
usb_endpoint_info* endpoint = &interfaceInfo->endpoint[i];
Pipe* pipe = NULL;