don't crash on invalid tiff

This commit is contained in:
David Rose 2004-11-26 22:35:00 +00:00
parent 7a1310b819
commit 024da67802
1 changed files with 3 additions and 1 deletions

View File

@ -513,7 +513,9 @@ Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number) :
////////////////////////////////////////////////////////////////////
PNMFileTypeTIFF::Reader::
~Reader() {
TIFFClose( tif );
if (tif != (struct tiff *)NULL) {
TIFFClose(tif);
}
}
////////////////////////////////////////////////////////////////////