tools/tiff2pdf.c:5326: error: Buffer Overrun S2
  Offset: [`t2p->pdf_ojpegdatalength`, +oo] Size: [0, +oo] by call to `t2p_readwrite_pdf_image_tile`.

tools/tiff2pdf.c:5206:1: Parameter `t2p->pdf_ojpegdatalength`
5204. */
5205. 
5206. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
      ^
5207. 
5208. 	tsize_t written=0;

tools/tiff2pdf.c:5326:16: Call
5324. 				streamlen=written;
5325. 				t2p_read_tiff_size_tile(t2p, input, i2);
5326. 				written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);
                     ^
5327. 				t2p_write_advance_directory(t2p, output);
5328. 				if(t2p->t2p_error!=T2P_ERR_OK){return(0);}

tools/tiff2pdf.c:2650:1: <Offset trace>
2648.  */
2649. 
2650. tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
      ^
2651. 
2652. 	uint16 edge=0;

tools/tiff2pdf.c:2650:1: Parameter `t2p->pdf_ojpegdatalength`
  2648.  */
  2649. 
  2650. tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
        ^
  2651. 
  2652. 	uint16 edge=0;

tools/tiff2pdf.c:2760:4: Assignment
  2758. 				}
  2759. 			}
  2760. 			bufferoffset=t2p->pdf_ojpegdatalength;
           ^
  2761. 			bufferoffset+=TIFFReadRawTile(input, 
  2762. 					tile, 

tools/tiff2pdf.c:2761:4: Assignment
  2759. 			}
  2760. 			bufferoffset=t2p->pdf_ojpegdatalength;
  2761. 			bufferoffset+=TIFFReadRawTile(input, 
           ^
  2762. 					tile, 
  2763. 					(tdata_t) &(((unsigned char*)buffer)[bufferoffset]), 

tools/tiff2pdf.c:2765:29: Assignment
  2763. 					(tdata_t) &(((unsigned char*)buffer)[bufferoffset]), 
  2764. 					-1);
  2765. 			((unsigned char*)buffer)[bufferoffset++]=0xff;
                                    ^
  2766. 			((unsigned char*)buffer)[bufferoffset++]=0xd9;
  2767. 			t2pWriteFile(output, (tdata_t) buffer, bufferoffset);

tools/tiff2pdf.c:2650:1: <Length trace>
2648.  */
2649. 
2650. tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
      ^
2651. 
2652. 	uint16 edge=0;

tools/tiff2pdf.c:2650:1: Parameter `t2p->tiff_datasize`
  2648.  */
  2649. 
  2650. tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
        ^
  2651. 
  2652. 	uint16 edge=0;

tools/tiff2pdf.c:2735:28: Call
  2733. 				return(0);
  2734. 			}
  2735. 			buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
                                   ^
  2736. 			if(buffer==NULL){
  2737. 				TIFFError(TIFF2PDF_MODULE, 

libtiff/tif_unix.c:261:17: Assignment
    259. {
    260.         if (s == 0)
    261.                 return ((void *) NULL);
                         ^
    262. 
    263. 	return (malloc((size_t) s));

tools/tiff2pdf.c:2735:4: Assignment
  2733. 				return(0);
  2734. 			}
  2735. 			buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
           ^
  2736. 			if(buffer==NULL){
  2737. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:2766:4: Array access: Offset: [t2p->pdf_ojpegdatalength, +oo] Size: [0, +oo] by call to `t2p_readwrite_pdf_image_tile` 
  2764. 					-1);
  2765. 			((unsigned char*)buffer)[bufferoffset++]=0xff;
  2766. 			((unsigned char*)buffer)[bufferoffset++]=0xd9;
           ^
  2767. 			t2pWriteFile(output, (tdata_t) buffer, bufferoffset);
  2768. 			_TIFFfree(buffer);
