Tip of the day: Corrupt pictures
But today I got a note that TIFFStringToPictureMBS crashes for a given tiff. The reason is that the tiff data is too short. Not even the directory does fit inside. Reading the directory structure does crash here. To solve cases like this, you can decide to add padding bytes on the end of the data. For example allocate a memoryblock with 1 few kilobytes, get a string from them and append them to the tiff data. Now if data is too short, the read will succeed and not crash.
