]> sigrok.org Git - libsigrokdecode.git/commit
usb_packet: Handle invalid packets more gracefully.
authorUwe Hermann <redacted>
Fri, 14 Aug 2015 17:01:39 +0000 (19:01 +0200)
committerUwe Hermann <redacted>
Fri, 14 Aug 2015 17:16:48 +0000 (19:16 +0200)
commit3e84c443857ae649be31df7ca13690c6d3578e54
tree4173adb72616e9af3043721252306c25b0668f6d
parent42227c2d29c8330c955cf64cf92be0bf1bf4aeeb
usb_packet: Handle invalid packets more gracefully.

Previously the PD was blindly trying to decode any packet, no matter
whether it was too short (and/or bogus) or not, causing issues like this:

  srd: Calling usb_packet decode(): IndexError: list index out of range

Such cases of invalid input are now handled better by emitting "UNKNOWN"
and "Invalid packet" annotations.

This fixes bug #186.
decoders/usb_packet/pd.py