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

tools/tiff2pdf.c:5420:1: start of procedure t2p_write_pdf()
5418. */
5419. 
5420. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
      ^
5421. 
5422. 	tsize_t written=0;

tools/tiff2pdf.c:5422:2: 
5420. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
5421. 
5422. 	tsize_t written=0;
       ^
5423. 	ttile_t i2=0;
5424. 	tsize_t streamlen=0;

tools/tiff2pdf.c:5423:2: 
5421. 
5422. 	tsize_t written=0;
5423. 	ttile_t i2=0;
       ^
5424. 	tsize_t streamlen=0;
5425. 	uint16 i=0;

tools/tiff2pdf.c:5424:2: 
5422. 	tsize_t written=0;
5423. 	ttile_t i2=0;
5424. 	tsize_t streamlen=0;
       ^
5425. 	uint16 i=0;
5426. 

tools/tiff2pdf.c:5425:2: 
5423. 	ttile_t i2=0;
5424. 	tsize_t streamlen=0;
5425. 	uint16 i=0;
       ^
5426. 
5427. 	t2p_read_tiff_init(t2p, input);

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

tools/tiff2pdf.c:5428:5: Taking false branch
5426. 
5427. 	t2p_read_tiff_init(t2p, input);
5428. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
          ^
5429. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
5430. 	if(t2p->pdf_xrefoffsets==NULL){

tools/tiff2pdf.c:5429:46: Condition is true
5427. 	t2p_read_tiff_init(t2p, input);
5428. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5429. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
                                                   ^
5430. 	if(t2p->pdf_xrefoffsets==NULL){
5431. 		TIFFError(

tools/tiff2pdf.c:5429:46: Condition is true
5427. 	t2p_read_tiff_init(t2p, input);
5428. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5429. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
                                                   ^
5430. 	if(t2p->pdf_xrefoffsets==NULL){
5431. 		TIFFError(

tools/tiff2pdf.c:5429:2: 
5427. 	t2p_read_tiff_init(t2p, input);
5428. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5429. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
       ^
5430. 	if(t2p->pdf_xrefoffsets==NULL){
5431. 		TIFFError(

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

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

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

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

tools/tiff2pdf.c:5430:5: Taking false branch
5428. 	if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5429. 	t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
5430. 	if(t2p->pdf_xrefoffsets==NULL){
          ^
5431. 		TIFFError(
5432. 			TIFF2PDF_MODULE, 

tools/tiff2pdf.c:5438:2: 
5436. 		return(written);
5437. 	}
5438. 	t2p->pdf_xrefcount=0;
       ^
5439. 	t2p->pdf_catalog=1;
5440. 	t2p->pdf_info=2;

tools/tiff2pdf.c:5439:2: 
5437. 	}
5438. 	t2p->pdf_xrefcount=0;
5439. 	t2p->pdf_catalog=1;
       ^
5440. 	t2p->pdf_info=2;
5441. 	t2p->pdf_pages=3;

tools/tiff2pdf.c:5440:2: 
5438. 	t2p->pdf_xrefcount=0;
5439. 	t2p->pdf_catalog=1;
5440. 	t2p->pdf_info=2;
       ^
5441. 	t2p->pdf_pages=3;
5442. 	written += t2p_write_pdf_header(t2p, output);

tools/tiff2pdf.c:5441:2: 
5439. 	t2p->pdf_catalog=1;
5440. 	t2p->pdf_info=2;
5441. 	t2p->pdf_pages=3;
       ^
5442. 	written += t2p_write_pdf_header(t2p, output);
5443. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:5442:2: 
5440. 	t2p->pdf_info=2;
5441. 	t2p->pdf_pages=3;
5442. 	written += t2p_write_pdf_header(t2p, output);
       ^
5443. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5444. 	t2p->pdf_catalog=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3778:1: start of procedure t2p_write_pdf_header()
  3776. */
  3777. 
  3778. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
        ^
  3779. 
  3780. 	tsize_t written=0;

tools/tiff2pdf.c:3780:2: 
  3778. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
  3779. 
  3780. 	tsize_t written=0;
         ^
  3781. 	char buffer[16];
  3782. 	int buflen=0;

tools/tiff2pdf.c:3782:2: 
  3780. 	tsize_t written=0;
  3781. 	char buffer[16];
  3782. 	int buflen=0;
         ^
  3783. 	
  3784. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",

tools/tiff2pdf.c:3784:2: 
  3782. 	int buflen=0;
  3783. 	
  3784. 	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
         ^
  3785. 			  t2p->pdf_majorversion&0xff,
  3786. 			  t2p->pdf_minorversion&0xff);

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

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

tools/tiff2pdf.c:3788:2: 
  3786. 			  t2p->pdf_minorversion&0xff);
  3787. 	check_snprintf_ret(t2p, buflen, buffer);
  3788. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
         ^
  3789. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3790. 

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3789:2: 
  3787. 	check_snprintf_ret(t2p, buflen, buffer);
  3788. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
  3789. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
         ^
  3790. 
  3791. 	return(written);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3791:2: 
  3789. 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
  3790. 
  3791. 	return(written);
         ^
  3792. }
  3793. 

tools/tiff2pdf.c:3792:1: return from a call to t2p_write_pdf_header
  3790. 
  3791. 	return(written);
  3792. }
        ^
  3793. 
  3794. /*

tools/tiff2pdf.c:5443:2: 
5441. 	t2p->pdf_pages=3;
5442. 	written += t2p_write_pdf_header(t2p, output);
5443. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5444. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5445. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5444:2: 
5442. 	written += t2p_write_pdf_header(t2p, output);
5443. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5444. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
       ^
5445. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5446. 	written += t2p_write_pdf_catalog(t2p, output);

tools/tiff2pdf.c:5445:2: 
5443. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5444. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5445. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5446. 	written += t2p_write_pdf_catalog(t2p, output);
5447. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3798:1: start of procedure t2p_write_pdf_obj_start()
  3796. */
  3797. 
  3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3799. 
  3800. 	tsize_t written=0;

tools/tiff2pdf.c:3800:2: 
  3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3799. 
  3800. 	tsize_t written=0;
         ^
  3801. 	char buffer[32];
  3802. 	int buflen=0;

tools/tiff2pdf.c:3802:2: 
  3800. 	tsize_t written=0;
  3801. 	char buffer[32];
  3802. 	int buflen=0;
         ^
  3803. 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3804:2: 
  3802. 	int buflen=0;
  3803. 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );

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

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

tools/tiff2pdf.c:3806:2: 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3808. 

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3807:2: 
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3808. 
  3809. 	return(written);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3809:2: 
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3808. 
  3809. 	return(written);
         ^
  3810. }
  3811. 

tools/tiff2pdf.c:3810:1: return from a call to t2p_write_pdf_obj_start
  3808. 
  3809. 	return(written);
  3810. }
        ^
  3811. 
  3812. /*

tools/tiff2pdf.c:5446:2: 
5444. 	t2p->pdf_catalog=t2p->pdf_xrefcount;
5445. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5446. 	written += t2p_write_pdf_catalog(t2p, output);
       ^
5447. 	written += t2p_write_pdf_obj_end(output);
5448. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;

tools/tiff2pdf.c:4087:1: start of procedure t2p_write_pdf_catalog()
  4085.  */
  4086. 
  4087. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
        ^
  4088. {
  4089. 	tsize_t written = 0;

tools/tiff2pdf.c:4089:2: 
  4087. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
  4088. {
  4089. 	tsize_t written = 0;
         ^
  4090. 	char buffer[32];
  4091. 	int buflen = 0;

tools/tiff2pdf.c:4091:2: 
  4089. 	tsize_t written = 0;
  4090. 	char buffer[32];
  4091. 	int buflen = 0;
         ^
  4092. 
  4093. 	written += t2pWriteFile(output, 

tools/tiff2pdf.c:4093:2: 
  4091. 	int buflen = 0;
  4092. 
  4093. 	written += t2pWriteFile(output, 
         ^
  4094. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  4095. 		27);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:4096:2: 
  4094. 		(tdata_t)"<< \n/Type /Catalog \n/Pages ", 
  4095. 		27);
  4096. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
         ^
  4097. 	check_snprintf_ret(t2p, buflen, buffer);
  4098. 	written += t2pWriteFile(output, (tdata_t) buffer,

tools/tiff2pdf.c:4097:2: Taking false branch
  4095. 		27);
  4096. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  4097. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  4098. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4099. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));

tools/tiff2pdf.c:4097:2: Taking false branch
  4095. 		27);
  4096. 	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
  4097. 	check_snprintf_ret(t2p, buflen, buffer);
         ^
  4098. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4099. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));

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

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

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:4100:2: 
  4098. 	written += t2pWriteFile(output, (tdata_t) buffer,
  4099. 				TIFFmin((size_t)buflen, sizeof(buffer) - 1));
  4100. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
         ^
  4101. 	if(t2p->pdf_fitwindow){
  4102. 		written += t2pWriteFile(output, 

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

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

tools/tiff2pdf.c:4102:3: 
  4100. 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
  4101. 	if(t2p->pdf_fitwindow){
  4102. 		written += t2pWriteFile(output, 
          ^
  4103. 			(tdata_t) "/ViewerPreferences <</FitWindow true>>\n", 
  4104. 			39);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:4106:2: 
  4104. 			39);
  4105. 	}
  4106. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
         ^
  4107. 
  4108. 	return(written);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:4108:2: 
  4106. 	written += t2pWriteFile(output, (tdata_t)">>\n", 3);
  4107. 
  4108. 	return(written);
         ^
  4109. }
  4110. 

tools/tiff2pdf.c:4109:1: return from a call to t2p_write_pdf_catalog
  4107. 
  4108. 	return(written);
  4109. }
        ^
  4110. 
  4111. /*

tools/tiff2pdf.c:5447:2: 
5445. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5446. 	written += t2p_write_pdf_catalog(t2p, output);
5447. 	written += t2p_write_pdf_obj_end(output);
       ^
5448. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5449. 	t2p->pdf_info=t2p->pdf_xrefcount;

tools/tiff2pdf.c:3816:1: start of procedure t2p_write_pdf_obj_end()
  3814. */
  3815. 
  3816. tsize_t t2p_write_pdf_obj_end(TIFF* output){
        ^
  3817. 
  3818. 	tsize_t written=0;

tools/tiff2pdf.c:3818:2: 
  3816. tsize_t t2p_write_pdf_obj_end(TIFF* output){
  3817. 
  3818. 	tsize_t written=0;
         ^
  3819. 
  3820. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);

tools/tiff2pdf.c:3820:2: 
  3818. 	tsize_t written=0;
  3819. 
  3820. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
         ^
  3821. 
  3822. 	return(written);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3822:2: 
  3820. 	written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
  3821. 
  3822. 	return(written);
         ^
  3823. }
  3824. 

tools/tiff2pdf.c:3823:1: return from a call to t2p_write_pdf_obj_end
  3821. 
  3822. 	return(written);
  3823. }
        ^
  3824. 
  3825. /*

tools/tiff2pdf.c:5448:2: 
5446. 	written += t2p_write_pdf_catalog(t2p, output);
5447. 	written += t2p_write_pdf_obj_end(output);
5448. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
       ^
5449. 	t2p->pdf_info=t2p->pdf_xrefcount;
5450. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);

tools/tiff2pdf.c:5449:2: 
5447. 	written += t2p_write_pdf_obj_end(output);
5448. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5449. 	t2p->pdf_info=t2p->pdf_xrefcount;
       ^
5450. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5451. 	written += t2p_write_pdf_info(t2p, input, output);

tools/tiff2pdf.c:5450:2: 
5448. 	t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5449. 	t2p->pdf_info=t2p->pdf_xrefcount;
5450. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
       ^
5451. 	written += t2p_write_pdf_info(t2p, input, output);
5452. 	written += t2p_write_pdf_obj_end(output);

tools/tiff2pdf.c:3798:1: start of procedure t2p_write_pdf_obj_start()
  3796. */
  3797. 
  3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
        ^
  3799. 
  3800. 	tsize_t written=0;

tools/tiff2pdf.c:3800:2: 
  3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
  3799. 
  3800. 	tsize_t written=0;
         ^
  3801. 	char buffer[32];
  3802. 	int buflen=0;

tools/tiff2pdf.c:3802:2: 
  3800. 	tsize_t written=0;
  3801. 	char buffer[32];
  3802. 	int buflen=0;
         ^
  3803. 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);

tools/tiff2pdf.c:3804:2: 
  3802. 	int buflen=0;
  3803. 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
         ^
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );

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

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

tools/tiff2pdf.c:3806:2: 
  3804. 	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
         ^
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3808. 

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3807:2: 
  3805. 	check_snprintf_ret((T2P*)NULL, buflen, buffer);
  3806. 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
         ^
  3808. 
  3809. 	return(written);

tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile()
    371. #endif /* OJPEG_SUPPORT */
    372. 
    373. static tmsize_t 
         ^
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {

tools/tiff2pdf.c:376:2: 
    374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
          ^
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	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:377:2: 
    375. {
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
          ^
    378. 	if (proc)
    379. 		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:378:6: Taking false branch
    376. 	thandle_t client = TIFFClientdata(tif);
    377. 	TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
    378. 	if (proc)
              ^
    379. 		return proc(client, data, size);
    380. 	return -1;

tools/tiff2pdf.c:380:2: 
    378. 	if (proc)
    379. 		return proc(client, data, size);
    380. 	return -1;
          ^
    381. }
    382. 

tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile
    379. 		return proc(client, data, size);
    380. 	return -1;
    381. }
         ^
    382. 
    383. static uint64

tools/tiff2pdf.c:3809:2: 
  3807. 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
  3808. 
  3809. 	return(written);
         ^
  3810. }
  3811. 

tools/tiff2pdf.c:3810:1: return from a call to t2p_write_pdf_obj_start
  3808. 
  3809. 	return(written);
  3810. }
        ^
  3811. 
  3812. /*

tools/tiff2pdf.c:5451:2: Skipping t2p_write_pdf_info(): empty list of specs
5449. 	t2p->pdf_info=t2p->pdf_xrefcount;
5450. 	written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5451. 	written += t2p_write_pdf_info(t2p, input, output);
       ^
5452. 	written += t2p_write_pdf_obj_end(output);
5453. 	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);
			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\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}']