missue #357 buffer overrun defensive coding
Merge pull request #364 from melissalinkert/rebased/develop/tiff-overflow

Buffer overrun defensive coding (rebased onto develop)