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

tools/tiff2pdf.c:5502:1: start of procedure t2p_write_pdf()
5500. */
5501. 
5502. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
      ^
5503. 
5504. 	tsize_t written=0;

tools/tiff2pdf.c:5504:2: 
5502. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
5503. 
5504. 	tsize_t written=0;
       ^
5505. 	ttile_t i2=0;
5506. 	tsize_t streamlen=0;

tools/tiff2pdf.c:5505:2: 
5503. 
5504. 	tsize_t written=0;
5505. 	ttile_t i2=0;
       ^
5506. 	tsize_t streamlen=0;
5507. 	uint16 i=0;

tools/tiff2pdf.c:5506:2: 
5504. 	tsize_t written=0;
5505. 	ttile_t i2=0;
5506. 	tsize_t streamlen=0;
       ^
5507. 	uint16 i=0;
5508. 

tools/tiff2pdf.c:5507:2: 
5505. 	ttile_t i2=0;
5506. 	tsize_t streamlen=0;
5507. 	uint16 i=0;
       ^
5508. 
5509. 	t2p_read_tiff_init(t2p, input);

tools/tiff2pdf.c:5509:2: Skipping t2p_read_tiff_init(): empty list of specs
5507. 	uint16 i=0;
5508. 
5509. 	t2p_read_tiff_init(t2p, input);
       ^
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );

tools/tiff2pdf.c:5510:5: Taking false branch
5508. 
5509. 	t2p_read_tiff_init(t2p, input);
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
          ^
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
5512. 	if(t2p->pdf_xrefoffsets==NULL){

tools/tiff2pdf.c:5511:46: Condition is true
5509. 	t2p_read_tiff_init(t2p, input);
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
                                                   ^
5512. 	if(t2p->pdf_xrefoffsets==NULL){
5513. 		TIFFError(

tools/tiff2pdf.c:5511:46: Condition is true
5509. 	t2p_read_tiff_init(t2p, input);
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
                                                   ^
5512. 	if(t2p->pdf_xrefoffsets==NULL){
5513. 		TIFFError(

tools/tiff2pdf.c:5511:2: 
5509. 	t2p_read_tiff_init(t2p, input);
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
       ^
5512. 	if(t2p->pdf_xrefoffsets==NULL){
5513. 		TIFFError(

libtiff/tif_unix.c:308:1: start of procedure _TIFFmalloc()
  306. #endif
  307. 
  308. void*
       ^
  309. _TIFFmalloc(tmsize_t s)
  310. {

libtiff/tif_unix.c:311:13: Taking false branch
  309. _TIFFmalloc(tmsize_t s)
  310. {
  311.         if (s == 0)
                   ^
  312.                 return ((void *) NULL);
  313. 

libtiff/tif_unix.c:314:2: 
  312.                 return ((void *) NULL);
  313. 
  314. 	return (malloc((size_t) s));
        ^
  315. }
  316. 

libtiff/tif_unix.c:315:1: return from a call to _TIFFmalloc
  313. 
  314. 	return (malloc((size_t) s));
  315. }
       ^
  316. 
  317. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)

tools/tiff2pdf.c:5512:5: Taking false branch
5510. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5511. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
5512. 	if(t2p->pdf_xrefoffsets==NULL){
          ^
5513. 		TIFFError(
5514. 			TIFF2PDF_MODULE, 

tools/tiff2pdf.c:5520:2: 
5518. 		return(written);
5519. 	}
5520. 	t2p->pdf_xrefcount=0;
       ^
5521. 	t2p->pdf_catalog=1;
5522. 	t2p->pdf_info=2;

tools/tiff2pdf.c:5521:2: 
5519. 	}
5520. 	t2p->pdf_xrefcount=0;
5521. 	t2p->pdf_catalog=1;
       ^
5522. 	t2p->pdf_info=2;
5523. 	t2p->pdf_pages=3;

tools/tiff2pdf.c:5522:2: 
5520. 	t2p->pdf_xrefcount=0;
5521. 	t2p->pdf_catalog=1;
5522. 	t2p->pdf_info=2;
       ^
5523. 	t2p->pdf_pages=3;
5524. 	written += t2p_write_pdf_header(t2p, output);

tools/tiff2pdf.c:5523:2: 
5521. 	t2p->pdf_catalog=1;
5522. 	t2p->pdf_info=2;
5523. 	t2p->pdf_pages=3;
       ^
5524. 	written += t2p_write_pdf_header(t2p, output);
5525. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:5524:2: 
5522. 	t2p->pdf_info=2;
5523. 	t2p->pdf_pages=3;
5524. 	written += t2p_write_pdf_header(t2p, output);
       ^
5525. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5526. 	t2p->pdf_catalog=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3865:1: start of procedure t2p_write_pdf_header()
  3863. */
  3864. 
  3865. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
        ^
  3866. 
  3867. 	tsize_t written=0;

tools/tiff2pdf.c:3867:2: 
  3865. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
  3866. 
  3867. 	tsize_t written=0;
         ^
  3868. 	char buffer[16];
  3869. 	int buflen=0;

tools/tiff2pdf.c:3869:2: 
  3867. 	tsize_t written=0;
  3868. 	char buffer[16];
  3869. 	int buflen=0;
         ^
  3870. 	
  3871. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",

tools/tiff2pdf.c:3871:2: 
  3869. 	int buflen=0;
  3870. 	
  3871. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
         ^
  3872. 			  t2p->pdf_majorversion&0xff,
  3873. 			  t2p->pdf_minorversion&0xff);

tools/tiff2pdf.c:3874:2: Taking false branch
  3872. 			  t2p->pdf_majorversion&0xff,
  3873. 			  t2p->pdf_minorversion&0xff);
  3874. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  3875. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
  3876. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);

tools/tiff2pdf.c:3874:2: Taking false branch
  3872. 			  t2p->pdf_majorversion&0xff,
  3873. 			  t2p->pdf_minorversion&0xff);
  3874. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  3875. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
  3876. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);

tools/tiff2pdf.c:3875:2: 
  3873. 			  t2p->pdf_minorversion&0xff);
  3874. 	check_snprintf_ret(t2p, buflen, buffer);
  3875. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
         ^
  3876. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3877. 

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3876:2: 
  3874. 	check_snprintf_ret(t2p, buflen, buffer);
  3875. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
  3876. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
         ^
  3877. 
  3878. 	return(written);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3878:2: 
  3876. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3877. 
  3878. 	return(written);
         ^
  3879. }
  3880. 

tools/tiff2pdf.c:3879:1: return from a call to t2p_write_pdf_header
  3877. 
  3878. 	return(written);
  3879. }
        ^
  3880. 
  3881. /*

tools/tiff2pdf.c:5525:2: 
5523. 	t2p->pdf_pages=3;
5524. 	written += t2p_write_pdf_header(t2p, output);
5525. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5526. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5527. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5526:2: 
5524. 	written += t2p_write_pdf_header(t2p, output);
5525. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5526. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
       ^
5527. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5528. 	written += t2p_write_pdf_catalog(t2p, output);

tools/tiff2pdf.c:5527:2: 
5525. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5526. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5527. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5528. 	written += t2p_write_pdf_catalog(t2p, output);
5529. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3885:1: start of procedure t2p_write_pdf_obj_start()
  3883. */
  3884. 
  3885. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3886. 
  3887. 	tsize_t written=0;

tools/tiff2pdf.c:3887:2: 
  3885. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3886. 
  3887. 	tsize_t written=0;
         ^
  3888. 	char buffer[32];
  3889. 	int buflen=0;

tools/tiff2pdf.c:3889:2: 
  3887. 	tsize_t written=0;
  3888. 	char buffer[32];
  3889. 	int buflen=0;
         ^
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3891:2: 
  3889. 	int buflen=0;
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );

tools/tiff2pdf.c:3892:2: Taking false branch
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
         ^
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3892:2: Taking false branch
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
         ^
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3893:2: 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3895. 

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3894:2: 
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3895. 
  3896. 	return(written);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3896:2: 
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3895. 
  3896. 	return(written);
         ^
  3897. }
  3898. 

tools/tiff2pdf.c:3897:1: return from a call to t2p_write_pdf_obj_start
  3895. 
  3896. 	return(written);
  3897. }
        ^
  3898. 
  3899. /*

tools/tiff2pdf.c:5528:2: 
5526. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5527. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5528. 	written += t2p_write_pdf_catalog(t2p, output);
       ^
5529. 	written += t2p_write_pdf_obj_end(output);
5530. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:4174:1: start of procedure t2p_write_pdf_catalog()
  4172.  */
  4173. 
  4174. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
        ^
  4175. {
  4176. 	tsize_t written = 0;

tools/tiff2pdf.c:4176:2: 
  4174. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
  4175. {
  4176. 	tsize_t written = 0;
         ^
  4177. 	char buffer[32];
  4178. 	int buflen = 0;

tools/tiff2pdf.c:4178:2: 
  4176. 	tsize_t written = 0;
  4177. 	char buffer[32];
  4178. 	int buflen = 0;
         ^
  4179. 
  4180. 	written += t2pWriteFile(output, 

tools/tiff2pdf.c:4180:2: 
  4178. 	int buflen = 0;
  4179. 
  4180. 	written += t2pWriteFile(output, 
         ^
  4181. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  4182. 		27);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:4183:2: 
  4181. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  4182. 		27);
  4183. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
         ^
  4184. 	check_snprintf_ret(t2p, buflen, buffer);
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,

tools/tiff2pdf.c:4184:2: Taking false branch
  4182. 		27);
  4183. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  4184. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4186. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));

tools/tiff2pdf.c:4184:2: Taking false branch
  4182. 		27);
  4183. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  4184. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4186. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));

tools/tiff2pdf.c:4186:5: Condition is false
  4184. 	check_snprintf_ret(t2p, buflen, buffer);
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4186. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
            ^
  4187. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  4188. 	if(t2p->pdf_fitwindow){

tools/tiff2pdf.c:4185:2: 
  4183. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  4184. 	check_snprintf_ret(t2p, buflen, buffer);
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,
         ^
  4186. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  4187. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:4187:2: 
  4185. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4186. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  4187. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
         ^
  4188. 	if(t2p->pdf_fitwindow){
  4189. 		written += t2pWriteFile(output, 

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

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

tools/tiff2pdf.c:4189:3: 
  4187. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  4188. 	if(t2p->pdf_fitwindow){
  4189. 		written += t2pWriteFile(output, 
          ^
  4190. 			(tdata_t) "/ViewerPreferences <</FitWindow true>>\n", 
  4191. 			39);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:4193:2: 
  4191. 			39);
  4192. 	}
  4193. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
         ^
  4194. 
  4195. 	return(written);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:4195:2: 
  4193. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
  4194. 
  4195. 	return(written);
         ^
  4196. }
  4197. 

tools/tiff2pdf.c:4196:1: return from a call to t2p_write_pdf_catalog
  4194. 
  4195. 	return(written);
  4196. }
        ^
  4197. 
  4198. /*

tools/tiff2pdf.c:5529:2: 
5527. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5528. 	written += t2p_write_pdf_catalog(t2p, output);
5529. 	written += t2p_write_pdf_obj_end(output);
       ^
5530. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5531. 	t2p->pdf_info=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3903:1: start of procedure t2p_write_pdf_obj_end()
  3901. */
  3902. 
  3903. tsize_t t2p_write_pdf_obj_end(TIFF* output){
        ^
  3904. 
  3905. 	tsize_t written=0;

tools/tiff2pdf.c:3905:2: 
  3903. tsize_t t2p_write_pdf_obj_end(TIFF* output){
  3904. 
  3905. 	tsize_t written=0;
         ^
  3906. 
  3907. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);

tools/tiff2pdf.c:3907:2: 
  3905. 	tsize_t written=0;
  3906. 
  3907. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
         ^
  3908. 
  3909. 	return(written);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3909:2: 
  3907. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
  3908. 
  3909. 	return(written);
         ^
  3910. }
  3911. 

tools/tiff2pdf.c:3910:1: return from a call to t2p_write_pdf_obj_end
  3908. 
  3909. 	return(written);
  3910. }
        ^
  3911. 
  3912. /*

tools/tiff2pdf.c:5530:2: 
5528. 	written += t2p_write_pdf_catalog(t2p, output);
5529. 	written += t2p_write_pdf_obj_end(output);
5530. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5531. 	t2p->pdf_info=t2p->pdf_xrefcount;
5532. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5531:2: 
5529. 	written += t2p_write_pdf_obj_end(output);
5530. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5531. 	t2p->pdf_info=t2p->pdf_xrefcount;
       ^
5532. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5533. 	written += t2p_write_pdf_info(t2p, input, output);

tools/tiff2pdf.c:5532:2: 
5530. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5531. 	t2p->pdf_info=t2p->pdf_xrefcount;
5532. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5533. 	written += t2p_write_pdf_info(t2p, input, output);
5534. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3885:1: start of procedure t2p_write_pdf_obj_start()
  3883. */
  3884. 
  3885. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3886. 
  3887. 	tsize_t written=0;

tools/tiff2pdf.c:3887:2: 
  3885. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3886. 
  3887. 	tsize_t written=0;
         ^
  3888. 	char buffer[32];
  3889. 	int buflen=0;

tools/tiff2pdf.c:3889:2: 
  3887. 	tsize_t written=0;
  3888. 	char buffer[32];
  3889. 	int buflen=0;
         ^
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3891:2: 
  3889. 	int buflen=0;
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );

tools/tiff2pdf.c:3892:2: Taking false branch
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
         ^
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3892:2: Taking false branch
  3890. 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
         ^
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);

tools/tiff2pdf.c:3893:2: 
  3891. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3895. 

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3894:2: 
  3892. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3893. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3895. 
  3896. 	return(written);

tools/tiff2pdf.c:383:1: start of procedure t2pWriteFile()
    381. #endif /* OJPEG_SUPPORT */
    382. 
    383. static tmsize_t 
         ^
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {

tools/tiff2pdf.c:386:2: 
    384. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
          ^
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)

libtiff/tif_open.c:552:1: start of procedure TIFFClientdata()
      550.  * Return open file's clientdata.
      551.  */
      552. thandle_t
           ^
      553. TIFFClientdata(TIFF* tif)
      554. {

libtiff/tif_open.c:555:2: 
      553. TIFFClientdata(TIFF* tif)
      554. {
      555. 	return (tif->tif_clientdata);
            ^
      556. }
      557. 

libtiff/tif_open.c:556:1: return from a call to TIFFClientdata
      554. {
      555. 	return (tif->tif_clientdata);
      556. }
           ^
      557. 
      558. /*

tools/tiff2pdf.c:387:2: 
    385. {
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    388. 	if (proc)
    389. 		return proc(client, data, size);

libtiff/tif_open.c:683:1: start of procedure TIFFGetWriteProc()
      681.  * Return pointer to file write method.
      682.  */
      683. TIFFReadWriteProc
           ^
      684. TIFFGetWriteProc(TIFF* tif)
      685. {

libtiff/tif_open.c:686:2: 
      684. TIFFGetWriteProc(TIFF* tif)
      685. {
      686. 	return (tif->tif_writeproc);
            ^
      687. }
      688. 

libtiff/tif_open.c:687:1: return from a call to TIFFGetWriteProc
      685. {
      686. 	return (tif->tif_writeproc);
      687. }
           ^
      688. 
      689. /*

tools/tiff2pdf.c:388:6: Taking false branch
    386. 	thandle_t client = TIFFClientdata(tif);
    387. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    388. 	if (proc)
              ^
    389. 		return proc(client, data, size);
    390. 	return -1;

tools/tiff2pdf.c:390:2: 
    388. 	if (proc)
    389. 		return proc(client, data, size);
    390. 	return -1;
          ^
    391. }
    392. 

tools/tiff2pdf.c:391:1: return from a call to t2pWriteFile
    389. 		return proc(client, data, size);
    390. 	return -1;
    391. }
         ^
    392. 
    393. static uint64

tools/tiff2pdf.c:3896:2: 
  3894. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3895. 
  3896. 	return(written);
         ^
  3897. }
  3898. 

tools/tiff2pdf.c:3897:1: return from a call to t2p_write_pdf_obj_start
  3895. 
  3896. 	return(written);
  3897. }
        ^
  3898. 
  3899. /*

tools/tiff2pdf.c:5533:2: Skipping t2p_write_pdf_info(): empty list of specs
5531. 	t2p->pdf_info=t2p->pdf_xrefcount;
5532. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5533. 	written += t2p_write_pdf_info(t2p, input, output);
       ^
5534. 	written += t2p_write_pdf_obj_end(output);
5535. 	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(TIFFSafeMultiply(tmsize_t,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);
				written += t2p_write_pdf_transfer_stream(t2p, output, i);
				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);
			written += t2p_write_pdf_xobject_palettecs_stream(t2p, output);
			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);
			written += t2p_write_pdf_xobject_icccs_stream(t2p, output);
			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);
			if (t2p->tiff_maxdatasize && (t2p->tiff_datasize > t2p->tiff_maxdatasize)) {
				TIFFError(TIFF2PDF_MODULE,
					"Allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ". Use -m option to change limit",
					(uint64)t2p->tiff_datasize, (uint64)t2p->tiff_maxdatasize);
				t2p->t2p_error = T2P_ERR_ERROR;
				return (0);
			}
			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(TIFFSafeMultiply(tmsize_t,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\twritten += t2p_write_pdf_transfer_stream(t2p, output, i);\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\twritten += t2p_write_pdf_xobject_palettecs_stream(t2p, output);\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\twritten += t2p_write_pdf_xobject_icccs_stream(t2p, output);\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\tif (t2p->tiff_maxdatasize && (t2p->tiff_datasize > t2p->tiff_maxdatasize)) {\n\t\t\t\tTIFFError(TIFF2PDF_MODULE,\n\t\t\t\t\t"Allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ". Use -m option to change limit",\n\t\t\t\t\t(uint64)t2p->tiff_datasize, (uint64)t2p->tiff_maxdatasize);\n\t\t\t\tt2p->t2p_error = T2P_ERR_ERROR;\n\t\t\t\treturn (0);\n\t\t\t}\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\tcheck_snprintf_ret(t2p, buflen, buffer);\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\tcheck_snprintf_ret((T2P*)NULL, buflen, buffer);\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\tcheck_snprintf_ret(t2p, buflen, buffer);\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}']