]> git.imager.perl.org - imager.git/commitdiff
Hack to prevent crashing when libtiff wants to check the filesize of a file.
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Wed, 23 Jan 2002 02:34:20 +0000 (02:34 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Wed, 23 Jan 2002 02:34:20 +0000 (02:34 +0000)
This only happens when certain conditions hold true in the tiff file.

tiff.c

diff --git a/tiff.c b/tiff.c
index 8f72bc2754506c0e1f9e567a41a9d68230c95b04..317c599ea5d74d0ab08b04806b244a0cecafc295 100644 (file)
--- a/tiff.c
+++ b/tiff.c
@@ -67,6 +67,12 @@ static void expand_4bit_hl(unsigned char *buf, int count);
 
 static void pack_4bit_hl(unsigned char *buf, int count);
 
+
+static toff_t sizeproc(thandle_t x) {
+       return 0;
+}
+
+
 /*
 =item comp_seek(h, o, w)
 
@@ -327,7 +333,7 @@ i_readtiff_wiol(io_glue *ig, int length) {
                       (TIFFReadWriteProc) ig->writecb,
                       (TIFFSeekProc) comp_seek,
                       (TIFFCloseProc) ig->closecb,
-                      (TIFFSizeProc) ig->sizecb,
+                      ig->sizecb ? (TIFFSizeProc) ig->sizecb : (TIFFSizeProc) sizeproc,
                       (TIFFMapFileProc) NULL,
                       (TIFFUnmapFileProc) NULL);