fix jpeg decode crash

https://code.google.com/p/go/source/detail?r=ad08d1df11af