tools/tiff2pdf.c:5237: error: Memory Leak
  memory dynamically allocated by call to `_TIFFmalloc()` at line 5215, column 34 is not reachable after line 5237, column 13.

tools/tiff2pdf.c:5206:1: start of procedure t2p_write_pdf()
5204. */
5205. 
5206. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
      ^
5207. 
5208. 	tsize_t written=0;

tools/tiff2pdf.c:5208:2: 
5206. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
5207. 
5208. 	tsize_t written=0;
       ^
5209. 	ttile_t i2=0;
5210. 	tsize_t streamlen=0;

tools/tiff2pdf.c:5209:2: 
5207. 
5208. 	tsize_t written=0;
5209. 	ttile_t i2=0;
       ^
5210. 	tsize_t streamlen=0;
5211. 	uint16 i=0;

tools/tiff2pdf.c:5210:2: 
5208. 	tsize_t written=0;
5209. 	ttile_t i2=0;
5210. 	tsize_t streamlen=0;
       ^
5211. 	uint16 i=0;
5212. 

tools/tiff2pdf.c:5211:2: 
5209. 	ttile_t i2=0;
5210. 	tsize_t streamlen=0;
5211. 	uint16 i=0;
       ^
5212. 
5213. 	t2p_read_tiff_init(t2p, input);

tools/tiff2pdf.c:5213:2: Skipping t2p_read_tiff_init(): empty list of specs
5211. 	uint16 i=0;
5212. 
5213. 	t2p_read_tiff_init(t2p, input);
       ^
5214. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5215. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );

tools/tiff2pdf.c:5214:5: Taking false branch
5212. 
5213. 	t2p_read_tiff_init(t2p, input);
5214. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
          ^
5215. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
5216. 	if(t2p->pdf_xrefoffsets==NULL){

tools/tiff2pdf.c:5215:2: 
5213. 	t2p_read_tiff_init(t2p, input);
5214. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5215. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
       ^
5216. 	if(t2p->pdf_xrefoffsets==NULL){
5217. 		TIFFError(

libtiff/tif_unix.c:257:1: start of procedure _TIFFmalloc()
  255. #endif
  256. 
  257. void*
       ^
  258. _TIFFmalloc(tmsize_t s)
  259. {

libtiff/tif_unix.c:260:13: Taking false branch
  258. _TIFFmalloc(tmsize_t s)
  259. {
  260.         if (s == 0)
                   ^
  261.                 return ((void *) NULL);
  262. 

libtiff/tif_unix.c:263:2: 
  261.                 return ((void *) NULL);
  262. 
  263. 	return (malloc((size_t) s));
        ^
  264. }
  265. 

libtiff/tif_unix.c:264:1: return from a call to _TIFFmalloc
  262. 
  263. 	return (malloc((size_t) s));
  264. }
       ^
  265. 
  266. void

tools/tiff2pdf.c:5216:5: Taking false branch
5214. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5215. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
5216. 	if(t2p->pdf_xrefoffsets==NULL){
          ^
5217. 		TIFFError(
5218. 			TIFF2PDF_MODULE, 

tools/tiff2pdf.c:5224:2: 
5222. 		return(written);
5223. 	}
5224. 	t2p->pdf_xrefcount=0;
       ^
5225. 	t2p->pdf_catalog=1;
5226. 	t2p->pdf_info=2;

tools/tiff2pdf.c:5225:2: 
5223. 	}
5224. 	t2p->pdf_xrefcount=0;
5225. 	t2p->pdf_catalog=1;
       ^
5226. 	t2p->pdf_info=2;
5227. 	t2p->pdf_pages=3;

tools/tiff2pdf.c:5226:2: 
5224. 	t2p->pdf_xrefcount=0;
5225. 	t2p->pdf_catalog=1;
5226. 	t2p->pdf_info=2;
       ^
5227. 	t2p->pdf_pages=3;
5228. 	written += t2p_write_pdf_header(t2p, output);

tools/tiff2pdf.c:5227:2: 
5225. 	t2p->pdf_catalog=1;
5226. 	t2p->pdf_info=2;
5227. 	t2p->pdf_pages=3;
       ^
5228. 	written += t2p_write_pdf_header(t2p, output);
5229. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:5228:2: 
5226. 	t2p->pdf_info=2;
5227. 	t2p->pdf_pages=3;
5228. 	written += t2p_write_pdf_header(t2p, output);
       ^
5229. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5230. 	t2p->pdf_catalog=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3628:1: start of procedure t2p_write_pdf_header()
  3626. */
  3627. 
  3628. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
        ^
  3629. 
  3630. 	tsize_t written=0;

tools/tiff2pdf.c:3630:2: 
  3628. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
  3629. 
  3630. 	tsize_t written=0;
         ^
  3631. 	char buffer[16];
  3632. 	int buflen=0;

tools/tiff2pdf.c:3632:2: 
  3630. 	tsize_t written=0;
  3631. 	char buffer[16];
  3632. 	int buflen=0;
         ^
  3633. 	
  3634. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",

tools/tiff2pdf.c:3634:2: 
  3632. 	int buflen=0;
  3633. 	
  3634. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
         ^
  3635. 			  t2p->pdf_majorversion&0xff,
  3636. 			  t2p->pdf_minorversion&0xff);

tools/tiff2pdf.c:3637:2: 
  3635. 			  t2p->pdf_majorversion&0xff,
  3636. 			  t2p->pdf_minorversion&0xff);
  3637. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
         ^
  3638. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3639. 

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3638:2: 
  3636. 			  t2p->pdf_minorversion&0xff);
  3637. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
  3638. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
         ^
  3639. 
  3640. 	return(written);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3640:2: 
  3638. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3639. 
  3640. 	return(written);
         ^
  3641. }
  3642. 

tools/tiff2pdf.c:3641:1: return from a call to t2p_write_pdf_header
  3639. 
  3640. 	return(written);
  3641. }
        ^
  3642. 
  3643. /*

tools/tiff2pdf.c:5229:2: 
5227. 	t2p->pdf_pages=3;
5228. 	written += t2p_write_pdf_header(t2p, output);
5229. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5230. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5231. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5230:2: 
5228. 	written += t2p_write_pdf_header(t2p, output);
5229. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5230. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
       ^
5231. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5232. 	written += t2p_write_pdf_catalog(t2p, output);

tools/tiff2pdf.c:5231:2: 
5229. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5230. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5231. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5232. 	written += t2p_write_pdf_catalog(t2p, output);
5233. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3647:1: start of procedure t2p_write_pdf_obj_start()
  3645. */
  3646. 
  3647. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3648. 
  3649. 	tsize_t written=0;

tools/tiff2pdf.c:3649:2: 
  3647. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3648. 
  3649. 	tsize_t written=0;
         ^
  3650. 	char buffer[32];
  3651. 	int buflen=0;

tools/tiff2pdf.c:3651:2: 
  3649. 	tsize_t written=0;
  3650. 	char buffer[32];
  3651. 	int buflen=0;
         ^
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3653:2: 
  3651. 	int buflen=0;
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3654:2: 
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3656. 

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3655:2: 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3656. 
  3657. 	return(written);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3657:2: 
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3656. 
  3657. 	return(written);
         ^
  3658. }
  3659. 

tools/tiff2pdf.c:3658:1: return from a call to t2p_write_pdf_obj_start
  3656. 
  3657. 	return(written);
  3658. }
        ^
  3659. 
  3660. /*

tools/tiff2pdf.c:5232:2: 
5230. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5231. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5232. 	written += t2p_write_pdf_catalog(t2p, output);
       ^
5233. 	written += t2p_write_pdf_obj_end(output);
5234. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:3933:1: start of procedure t2p_write_pdf_catalog()
  3931.  */
  3932. 
  3933. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
        ^
  3934. {
  3935. 	tsize_t written = 0;

tools/tiff2pdf.c:3935:2: 
  3933. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
  3934. {
  3935. 	tsize_t written = 0;
         ^
  3936. 	char buffer[32];
  3937. 	int buflen = 0;

tools/tiff2pdf.c:3937:2: 
  3935. 	tsize_t written = 0;
  3936. 	char buffer[32];
  3937. 	int buflen = 0;
         ^
  3938. 
  3939. 	written += t2pWriteFile(output, 

tools/tiff2pdf.c:3939:2: 
  3937. 	int buflen = 0;
  3938. 
  3939. 	written += t2pWriteFile(output, 
         ^
  3940. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  3941. 		27);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3942:2: 
  3940. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  3941. 		27);
  3942. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
         ^
  3943. 	written += t2pWriteFile(output, (tdata_t) buffer,
  3944. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));

tools/tiff2pdf.c:3944:5: Condition is false
  3942. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  3943. 	written += t2pWriteFile(output, (tdata_t) buffer,
  3944. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
            ^
  3945. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  3946. 	if(t2p->pdf_fitwindow){

tools/tiff2pdf.c:3943:2: 
  3941. 		27);
  3942. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  3943. 	written += t2pWriteFile(output, (tdata_t) buffer,
         ^
  3944. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  3945. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3945:2: 
  3943. 	written += t2pWriteFile(output, (tdata_t) buffer,
  3944. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  3945. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
         ^
  3946. 	if(t2p->pdf_fitwindow){
  3947. 		written += t2pWriteFile(output, 

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3946:5: Taking true branch
  3944. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  3945. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  3946. 	if(t2p->pdf_fitwindow){
            ^
  3947. 		written += t2pWriteFile(output, 
  3948. 			(tdata_t) "/ViewerPreferences <</FitWindow true>>\n", 

tools/tiff2pdf.c:3947:3: 
  3945. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  3946. 	if(t2p->pdf_fitwindow){
  3947. 		written += t2pWriteFile(output, 
          ^
  3948. 			(tdata_t) "/ViewerPreferences <</FitWindow true>>\n", 
  3949. 			39);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3951:2: 
  3949. 			39);
  3950. 	}
  3951. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
         ^
  3952. 
  3953. 	return(written);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3953:2: 
  3951. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
  3952. 
  3953. 	return(written);
         ^
  3954. }
  3955. 

tools/tiff2pdf.c:3954:1: return from a call to t2p_write_pdf_catalog
  3952. 
  3953. 	return(written);
  3954. }
        ^
  3955. 
  3956. /*

tools/tiff2pdf.c:5233:2: 
5231. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5232. 	written += t2p_write_pdf_catalog(t2p, output);
5233. 	written += t2p_write_pdf_obj_end(output);
       ^
5234. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5235. 	t2p->pdf_info=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3664:1: start of procedure t2p_write_pdf_obj_end()
  3662. */
  3663. 
  3664. tsize_t t2p_write_pdf_obj_end(TIFF* output){
        ^
  3665. 
  3666. 	tsize_t written=0;

tools/tiff2pdf.c:3666:2: 
  3664. tsize_t t2p_write_pdf_obj_end(TIFF* output){
  3665. 
  3666. 	tsize_t written=0;
         ^
  3667. 
  3668. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);

tools/tiff2pdf.c:3668:2: 
  3666. 	tsize_t written=0;
  3667. 
  3668. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
         ^
  3669. 
  3670. 	return(written);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3670:2: 
  3668. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
  3669. 
  3670. 	return(written);
         ^
  3671. }
  3672. 

tools/tiff2pdf.c:3671:1: return from a call to t2p_write_pdf_obj_end
  3669. 
  3670. 	return(written);
  3671. }
        ^
  3672. 
  3673. /*

tools/tiff2pdf.c:5234:2: 
5232. 	written += t2p_write_pdf_catalog(t2p, output);
5233. 	written += t2p_write_pdf_obj_end(output);
5234. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5235. 	t2p->pdf_info=t2p->pdf_xrefcount;
5236. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5235:2: 
5233. 	written += t2p_write_pdf_obj_end(output);
5234. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5235. 	t2p->pdf_info=t2p->pdf_xrefcount;
       ^
5236. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5237. 	written += t2p_write_pdf_info(t2p, input, output);

tools/tiff2pdf.c:5236:2: 
5234. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5235. 	t2p->pdf_info=t2p->pdf_xrefcount;
5236. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5237. 	written += t2p_write_pdf_info(t2p, input, output);
5238. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3647:1: start of procedure t2p_write_pdf_obj_start()
  3645. */
  3646. 
  3647. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3648. 
  3649. 	tsize_t written=0;

tools/tiff2pdf.c:3649:2: 
  3647. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3648. 
  3649. 	tsize_t written=0;
         ^
  3650. 	char buffer[32];
  3651. 	int buflen=0;

tools/tiff2pdf.c:3651:2: 
  3649. 	tsize_t written=0;
  3650. 	char buffer[32];
  3651. 	int buflen=0;
         ^
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3653:2: 
  3651. 	int buflen=0;
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3654:2: 
  3652. 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3656. 

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3655:2: 
  3653. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3654. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3656. 
  3657. 	return(written);

tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
    361. }
    362. 
    363. static tmsize_t 
         ^
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {

tools/tiff2pdf.c:366:2: 
    364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
          ^
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)

libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
      534.  * Return open file's clientdata.
      535.  */
      536. thandle_t
           ^
      537. TIFFClientdata(TIFF* tif)
      538. {

libtiff/tif_open.c:539:2: 
      537. TIFFClientdata(TIFF* tif)
      538. {
      539. 	return (tif->tif_clientdata);
            ^
      540. }
      541. 

libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
      538. {
      539. 	return (tif->tif_clientdata);
      540. }
           ^
      541. 
      542. /*

tools/tiff2pdf.c:367:2: 
    365. {
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    368. 	if (proc)
    369. 		return proc(client, data, size);

libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
      665.  * Return pointer to file write method.
      666.  */
      667. TIFFReadWriteProc
           ^
      668. TIFFGetWriteProc(TIFF* tif)
      669. {

libtiff/tif_open.c:670:2: 
      668. TIFFGetWriteProc(TIFF* tif)
      669. {
      670. 	return (tif->tif_writeproc);
            ^
      671. }
      672. 

libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
      669. {
      670. 	return (tif->tif_writeproc);
      671. }
           ^
      672. 
      673. /*

tools/tiff2pdf.c:368:6: Taking false branch
    366. 	thandle_t client = TIFFClientdata(tif);
    367. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    368. 	if (proc)
              ^
    369. 		return proc(client, data, size);
    370. 	return -1;

tools/tiff2pdf.c:370:2: 
    368. 	if (proc)
    369. 		return proc(client, data, size);
    370. 	return -1;
          ^
    371. }
    372. 

tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
    369. 		return proc(client, data, size);
    370. 	return -1;
    371. }
         ^
    372. 
    373. static uint64

tools/tiff2pdf.c:3657:2: 
  3655. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3656. 
  3657. 	return(written);
         ^
  3658. }
  3659. 

tools/tiff2pdf.c:3658:1: return from a call to t2p_write_pdf_obj_start
  3656. 
  3657. 	return(written);
  3658. }
        ^
  3659. 
  3660. /*

tools/tiff2pdf.c:5237:2: Skipping t2p_write_pdf_info(): empty list of specs
5235. 	t2p->pdf_info=t2p->pdf_xrefcount;
5236. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5237. 	written += t2p_write_pdf_info(t2p, input, output);
       ^
5238. 	written += t2p_write_pdf_obj_end(output);
5239. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
	tsize_t written=0;
	ttile_t i2=0;
	tsize_t streamlen=0;
	uint16 i=0;
	t2p_read_tiff_init(t2p, input);
	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
	if(t2p->pdf_xrefoffsets==NULL){
		TIFFError(
			TIFF2PDF_MODULE,
			"Can't allocate %u bytes of memory for t2p_write_pdf",
			(unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) );
		t2p->t2p_error = T2P_ERR_ERROR;
		return(written);
	}
	t2p->pdf_xrefcount=0;
	t2p->pdf_catalog=1;
	t2p->pdf_info=2;
	t2p->pdf_pages=3;
	written += t2p_write_pdf_header(t2p, output);
	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
	t2p->pdf_catalog=t2p->pdf_xrefcount;
	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
	written += t2p_write_pdf_catalog(t2p, output);
	written += t2p_write_pdf_obj_end(output);
	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
	t2p->pdf_info=t2p->pdf_xrefcount;
	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
	written += t2p_write_pdf_info(t2p, input, output);
	written += t2p_write_pdf_obj_end(output);
	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
	t2p->pdf_pages=t2p->pdf_xrefcount;
	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
	written += t2p_write_pdf_pages(t2p, output);
	written += t2p_write_pdf_obj_end(output);
	for(t2p->pdf_page=0;t2p->pdf_page<t2p->tiff_pagecount;t2p->pdf_page++){
		t2p_read_tiff_data(t2p, input);
		if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
		t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
		written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
		written += t2p_write_pdf_page(t2p->pdf_xrefcount, t2p, output);
		written += t2p_write_pdf_obj_end(output);
		t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
		written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
		written += t2p_write_pdf_stream_dict_start(output);
		written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output);
		written += t2p_write_pdf_stream_dict_end(output);
		written += t2p_write_pdf_stream_start(output);
		streamlen=written;
		written += t2p_write_pdf_page_content_stream(t2p, output);
		streamlen=written-streamlen;
		written += t2p_write_pdf_stream_end(output);
		written += t2p_write_pdf_obj_end(output);
		t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
		written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
		written += t2p_write_pdf_stream_length(streamlen, output);
		written += t2p_write_pdf_obj_end(output);
		if(t2p->tiff_transferfunctioncount != 0){
			t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
			written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
			written += t2p_write_pdf_transfer(t2p, output);
			written += t2p_write_pdf_obj_end(output);
			for(i=0; i < t2p->tiff_transferfunctioncount; i++){
				t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
				written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
				written += t2p_write_pdf_stream_dict_start(output);
				written += t2p_write_pdf_transfer_dict(t2p, output, i);
				written += t2p_write_pdf_stream_dict_end(output);
				written += t2p_write_pdf_stream_start(output);
				streamlen=written;
				written += t2p_write_pdf_transfer_stream(t2p, output, i);
				streamlen=written-streamlen;
				written += t2p_write_pdf_stream_end(output);
				written += t2p_write_pdf_obj_end(output);
			}
		}
		if( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){
			t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
			t2p->pdf_palettecs=t2p->pdf_xrefcount;
			written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
			written += t2p_write_pdf_stream_dict_start(output);
			written += t2p_write_pdf_stream_dict(t2p->pdf_palettesize, 0, output);
			written += t2p_write_pdf_stream_dict_end(output);
			written += t2p_write_pdf_stream_start(output);
			streamlen=written;
			written += t2p_write_pdf_xobject_palettecs_stream(t2p, output);
			streamlen=written-streamlen;
			written += t2p_write_pdf_stream_end(output);
			written += t2p_write_pdf_obj_end(output);
		}
		if( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){
			t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
			t2p->pdf_icccs=t2p->pdf_xrefcount;
			written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
			written += t2p_write_pdf_stream_dict_start(output);
			written += t2p_write_pdf_xobject_icccs_dict(t2p, output);
			written += t2p_write_pdf_stream_dict_end(output);
			written += t2p_write_pdf_stream_start(output);
			streamlen=written;
			written += t2p_write_pdf_xobject_icccs_stream(t2p, output);
			streamlen=written-streamlen;
			written += t2p_write_pdf_stream_end(output);
			written += t2p_write_pdf_obj_end(output);
		}
		if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount !=0){
			for(i2=0;i2<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i2++){
				t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
				written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
				written += t2p_write_pdf_stream_dict_start(output);
				written += t2p_write_pdf_xobject_stream_dict(
					i2+1,
					t2p,
					output);
				written += t2p_write_pdf_stream_dict_end(output);
				written += t2p_write_pdf_stream_start(output);
				streamlen=written;
				t2p_read_tiff_size_tile(t2p, input, i2);
				written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);
				t2p_write_advance_directory(t2p, output);
				if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
				streamlen=written-streamlen;
				written += t2p_write_pdf_stream_end(output);
				written += t2p_write_pdf_obj_end(output);
				t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
				written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
				written += t2p_write_pdf_stream_length(streamlen, output);
				written += t2p_write_pdf_obj_end(output);
			}
		} else {
			t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
			written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
			written += t2p_write_pdf_stream_dict_start(output);
			written += t2p_write_pdf_xobject_stream_dict(
				0,
				t2p,
				output);
			written += t2p_write_pdf_stream_dict_end(output);
			written += t2p_write_pdf_stream_start(output);
			streamlen=written;
			t2p_read_tiff_size(t2p, input);
			written += t2p_readwrite_pdf_image(t2p, input, output);
			t2p_write_advance_directory(t2p, output);
			if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
			streamlen=written-streamlen;
			written += t2p_write_pdf_stream_end(output);
			written += t2p_write_pdf_obj_end(output);
			t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
			written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
			written += t2p_write_pdf_stream_length(streamlen, output);
			written += t2p_write_pdf_obj_end(output);
		}
	}
	t2p->pdf_startxref = written;
	written += t2p_write_pdf_xreftable(t2p, output);
	written += t2p_write_pdf_trailer(t2p, output);
	t2p_disable(output);
	return(written);
}
['tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){\n\ttsize_t written=0;\n\tttile_t i2=0;\n\ttsize_t streamlen=0;\n\tuint16 i=0;\n\tt2p_read_tiff_init(t2p, input);\n\tif(t2p->t2p_error!=T2P_ERR_OK){return(0);}\n\tt2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );\n\tif(t2p->pdf_xrefoffsets==NULL){\n\t\tTIFFError(\n\t\t\tTIFF2PDF_MODULE,\n\t\t\t"Can\'t allocate %u bytes of memory for t2p_write_pdf",\n\t\t\t(unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) );\n\t\tt2p->t2p_error = T2P_ERR_ERROR;\n\t\treturn(written);\n\t}\n\tt2p->pdf_xrefcount=0;\n\tt2p->pdf_catalog=1;\n\tt2p->pdf_info=2;\n\tt2p->pdf_pages=3;\n\twritten += t2p_write_pdf_header(t2p, output);\n\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\tt2p->pdf_catalog=t2p->pdf_xrefcount;\n\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\twritten += t2p_write_pdf_catalog(t2p, output);\n\twritten += t2p_write_pdf_obj_end(output);\n\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\tt2p->pdf_info=t2p->pdf_xrefcount;\n\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\twritten += t2p_write_pdf_info(t2p, input, output);\n\twritten += t2p_write_pdf_obj_end(output);\n\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\tt2p->pdf_pages=t2p->pdf_xrefcount;\n\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\twritten += t2p_write_pdf_pages(t2p, output);\n\twritten += t2p_write_pdf_obj_end(output);\n\tfor(t2p->pdf_page=0;t2p->pdf_page<t2p->tiff_pagecount;t2p->pdf_page++){\n\t\tt2p_read_tiff_data(t2p, input);\n\t\tif(t2p->t2p_error!=T2P_ERR_OK){return(0);}\n\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\twritten += t2p_write_pdf_page(t2p->pdf_xrefcount, t2p, output);\n\t\twritten += t2p_write_pdf_obj_end(output);\n\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\twritten += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output);\n\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\twritten += t2p_write_pdf_stream_start(output);\n\t\tstreamlen=written;\n\t\twritten += t2p_write_pdf_page_content_stream(t2p, output);\n\t\tstreamlen=written-streamlen;\n\t\twritten += t2p_write_pdf_stream_end(output);\n\t\twritten += t2p_write_pdf_obj_end(output);\n\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\twritten += t2p_write_pdf_stream_length(streamlen, output);\n\t\twritten += t2p_write_pdf_obj_end(output);\n\t\tif(t2p->tiff_transferfunctioncount != 0){\n\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\twritten += t2p_write_pdf_transfer(t2p, output);\n\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t\tfor(i=0; i < t2p->tiff_transferfunctioncount; i++){\n\t\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\t\t\twritten += t2p_write_pdf_transfer_dict(t2p, output, i);\n\t\t\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\t\t\twritten += t2p_write_pdf_stream_start(output);\n\t\t\t\tstreamlen=written;\n\t\t\t\twritten += t2p_write_pdf_transfer_stream(t2p, output, i);\n\t\t\t\tstreamlen=written-streamlen;\n\t\t\t\twritten += t2p_write_pdf_stream_end(output);\n\t\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t\t}\n\t\t}\n\t\tif( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){\n\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\tt2p->pdf_palettecs=t2p->pdf_xrefcount;\n\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\t\twritten += t2p_write_pdf_stream_dict(t2p->pdf_palettesize, 0, output);\n\t\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\t\twritten += t2p_write_pdf_stream_start(output);\n\t\t\tstreamlen=written;\n\t\t\twritten += t2p_write_pdf_xobject_palettecs_stream(t2p, output);\n\t\t\tstreamlen=written-streamlen;\n\t\t\twritten += t2p_write_pdf_stream_end(output);\n\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t}\n\t\tif( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){\n\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\tt2p->pdf_icccs=t2p->pdf_xrefcount;\n\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\t\twritten += t2p_write_pdf_xobject_icccs_dict(t2p, output);\n\t\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\t\twritten += t2p_write_pdf_stream_start(output);\n\t\t\tstreamlen=written;\n\t\t\twritten += t2p_write_pdf_xobject_icccs_stream(t2p, output);\n\t\t\tstreamlen=written-streamlen;\n\t\t\twritten += t2p_write_pdf_stream_end(output);\n\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t}\n\t\tif(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount !=0){\n\t\t\tfor(i2=0;i2<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i2++){\n\t\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\t\t\twritten += t2p_write_pdf_xobject_stream_dict(\n\t\t\t\t\ti2+1,\n\t\t\t\t\tt2p,\n\t\t\t\t\toutput);\n\t\t\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\t\t\twritten += t2p_write_pdf_stream_start(output);\n\t\t\t\tstreamlen=written;\n\t\t\t\tt2p_read_tiff_size_tile(t2p, input, i2);\n\t\t\t\twritten += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);\n\t\t\t\tt2p_write_advance_directory(t2p, output);\n\t\t\t\tif(t2p->t2p_error!=T2P_ERR_OK){return(0);}\n\t\t\t\tstreamlen=written-streamlen;\n\t\t\t\twritten += t2p_write_pdf_stream_end(output);\n\t\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\t\twritten += t2p_write_pdf_stream_length(streamlen, output);\n\t\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t\t}\n\t\t} else {\n\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\twritten += t2p_write_pdf_stream_dict_start(output);\n\t\t\twritten += t2p_write_pdf_xobject_stream_dict(\n\t\t\t\t0,\n\t\t\t\tt2p,\n\t\t\t\toutput);\n\t\t\twritten += t2p_write_pdf_stream_dict_end(output);\n\t\t\twritten += t2p_write_pdf_stream_start(output);\n\t\t\tstreamlen=written;\n\t\t\tt2p_read_tiff_size(t2p, input);\n\t\t\twritten += t2p_readwrite_pdf_image(t2p, input, output);\n\t\t\tt2p_write_advance_directory(t2p, output);\n\t\t\tif(t2p->t2p_error!=T2P_ERR_OK){return(0);}\n\t\t\tstreamlen=written-streamlen;\n\t\t\twritten += t2p_write_pdf_stream_end(output);\n\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t\tt2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;\n\t\t\twritten += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);\n\t\t\twritten += t2p_write_pdf_stream_length(streamlen, output);\n\t\t\twritten += t2p_write_pdf_obj_end(output);\n\t\t}\n\t}\n\tt2p->pdf_startxref = written;\n\twritten += t2p_write_pdf_xreftable(t2p, output);\n\twritten += t2p_write_pdf_trailer(t2p, output);\n\tt2p_disable(output);\n\treturn(written);\n}', 'void*\n_TIFFmalloc(tmsize_t s)\n{\n        if (s == 0)\n                return ((void *) NULL);\n\treturn (malloc((size_t) s));\n}', 'tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){\n\ttsize_t written=0;\n\tchar buffer[16];\n\tint buflen=0;\n\tbuflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",\n\t\t\t  t2p->pdf_majorversion&0xff,\n\t\t\t  t2p->pdf_minorversion&0xff);\n\twritten += t2pWriteFile(output, (tdata_t) buffer, buflen);\n\twritten += t2pWriteFile(output, (tdata_t)"\\n%\\342\\343\\317\\323\\n", 7);\n\treturn(written);\n}', 'static tmsize_t\nt2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)\n{\n\tthandle_t client = TIFFClientdata(tif);\n\tTIFFReadWriteProc proc = TIFFGetWriteProc(tif);\n\tif (proc)\n\t\treturn proc(client, data, size);\n\treturn -1;\n}', 'thandle_t\nTIFFClientdata(TIFF* tif)\n{\n\treturn (tif->tif_clientdata);\n}', 'TIFFReadWriteProc\nTIFFGetWriteProc(TIFF* tif)\n{\n\treturn (tif->tif_writeproc);\n}', 'tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){\n\ttsize_t written=0;\n\tchar buffer[32];\n\tint buflen=0;\n\tbuflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);\n\twritten += t2pWriteFile(output, (tdata_t) buffer, buflen );\n\twritten += t2pWriteFile(output, (tdata_t) " 0 obj\\n", 7);\n\treturn(written);\n}', 'tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)\n{\n\ttsize_t written = 0;\n\tchar buffer[32];\n\tint buflen = 0;\n\twritten += t2pWriteFile(output,\n\t\t(tdata_t)"<< \\n/Type /Catalog \\n/Pages ",\n\t\t27);\n\tbuflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);\n\twritten += t2pWriteFile(output, (tdata_t) buffer,\n\t\t\t\tTIFFmin((size_t)buflen, sizeof(buffer) - 1));\n\twritten += t2pWriteFile(output, (tdata_t) " 0 R \\n", 6);\n\tif(t2p->pdf_fitwindow){\n\t\twritten += t2pWriteFile(output,\n\t\t\t(tdata_t) "/ViewerPreferences <</FitWindow true>>\\n",\n\t\t\t39);\n\t}\n\twritten += t2pWriteFile(output, (tdata_t)">>\\n", 3);\n\treturn(written);\n}', 'tsize_t t2p_write_pdf_obj_end(TIFF* output){\n\ttsize_t written=0;\n\twritten += t2pWriteFile(output, (tdata_t) "endobj\\n", 7);\n\treturn(written);\n}']