TIFF: prevent skipping beyond the end of the file