From: Arnar Mar Hrafnkelsson Date: Wed, 23 Jan 2002 02:34:20 +0000 (+0000) Subject: Hack to prevent crashing when libtiff wants to check the filesize of a file. X-Git-Tag: Imager-0.48^2~426 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/caa833d5715e3fbe5d4d02636b19f244595d8f3a Hack to prevent crashing when libtiff wants to check the filesize of a file. This only happens when certain conditions hold true in the tiff file. --- diff --git a/tiff.c b/tiff.c index 8f72bc27..317c599e 100644 --- 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);