From 024da67802d85d5adb1e31ec426b592eb8d23738 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 26 Nov 2004 22:35:00 +0000 Subject: [PATCH] don't crash on invalid tiff --- panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx index 31cf0e0796..113aed9b53 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx @@ -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); + } } ////////////////////////////////////////////////////////////////////