ALSA: usb-audio: Add sanity checks for endpoint accesses
[pandora-kernel.git] / sound / usb / pcm.c
index 983e071..d5cdf1f 100644 (file)
@@ -148,6 +148,8 @@ static int init_pitch_v1(struct snd_usb_audio *chip, int iface,
        unsigned char data[1];
        int err;
 
+       if (get_iface_desc(alts)->bNumEndpoints < 1)
+               return -EINVAL;
        ep = get_endpoint(alts, 0)->bEndpointAddress;
 
        data[0] = 1;