[alsa-devel] [PATCH 05/44] firewire-lib: Add support for MIDI capture/playback

Clemens Ladisch clemens at ladisch.de
Thu Apr 3 10:54:53 CEST 2014


Takashi Sakamoto wrote:
>>> +        len = b[0] - 0x80;
>>> +        if ((len > 1) &&  (3 < len) && (s->midi[port]))
>>
>> This condition is true only for len==2.
>
> Oh... It's my fault. I think I did focus on device's quirk for sequence of dbc value and didn't pay enough attension to these lines...
>
> In these lines I allow this module to pick up MIDI messages according to IEC 61883-6. 1/2/3 bytes can be transmitted. So it should be:
>
>  +        len = b[0] - 0x80;
>  +        if ((1 < len) &&  (len < 3) && (s->midi[port]))

This is still wrong.  It should be:

		len = b[0] - 0x80;
		if (1 <= len && len <= 3 && s->midi[port])


Regards,
Clemens


More information about the Alsa-devel mailing list