To reproduce:
1) Make a chest and put something into it
2) hex-edit the entities.dat to change the item ID into something absurd e.g. 55
3) Open the world again, open the chest inventory and try to take something from the invalid item box
4) Crash!
This does not happen with the inventory - any invalid items are automatically removed.
A video by sasuke082594 that demonstrates this issue: http://www.youtube.com/watch?v=Ha2gD9LNqR4
This could also affect worlds moved from one version to another, for example.