fix crash on some strange data from Pentax device, thanks Harald Lenz