Handle incomplete packets (merged libaesdec.c from tvheadend)