When something is wrong in the middle of decoding a packet, you get an error, and decoding is aborted and you don't get half of the decoded packet.
But, templates and options in this packet which were valid and added before the error was seen are not removed. This is bad behavior IMO, I think we should only add all templates/options after decoding is finished, and everything is known to be correct.