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

tools/tiff2pdf.c:5557:1: Parameter `t2p->pdf_ojpegdatalength`
5555. */
5556. 
5557. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
      ^
5558. 
5559. 	tsize_t written=0;

tools/tiff2pdf.c:5707:15: Call
5705. 				return (0);
5706. 			}
5707. 			written += t2p_readwrite_pdf_image(t2p, input, output);
                    ^
5708. 			t2p_write_advance_directory(t2p, output);
5709. 			if(t2p->t2p_error!=T2P_ERR_OK){return(0);}

tools/tiff2pdf.c:2237:1: <Offset trace>
2235. */
2236. 
2237. tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
      ^
2238. 
2239. 	tsize_t written=0;

tools/tiff2pdf.c:2237:1: Parameter `t2p->pdf_ojpegdatalength`
  2235. */
  2236. 
  2237. tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
        ^
  2238. 
  2239. 	tsize_t written=0;

tools/tiff2pdf.c:2429:5: Assignment
  2427. 				memset(buffer, 0, t2p->tiff_datasize);
  2428. 				_TIFFmemcpy(buffer, t2p->pdf_ojpegdata, t2p->pdf_ojpegdatalength);
  2429. 				bufferoffset=t2p->pdf_ojpegdatalength;
            ^
  2430. 				stripcount=TIFFNumberOfStrips(input);
  2431. 				for(i=0;i<stripcount;i++){

tools/tiff2pdf.c:2237:1: <Length trace>
2235. */
2236. 
2237. tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
      ^
2238. 
2239. 	tsize_t written=0;

tools/tiff2pdf.c:2237:1: Parameter `t2p->tiff_datasize`
  2235. */
  2236. 
  2237. tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
        ^
  2238. 
  2239. 	tsize_t written=0;

tools/tiff2pdf.c:2418:6: Call
  2416. 				}
  2417. 				buffer = (unsigned char*)
  2418. 					_TIFFmalloc(t2p->tiff_datasize);
             ^
  2419. 				if(buffer==NULL){
  2420. 					TIFFError(TIFF2PDF_MODULE,

libtiff/tif_unix.c:312:17: Assignment
    310. {
    311.         if (s == 0)
    312.                 return ((void *) NULL);
                         ^
    313. 
    314. 	return (malloc((size_t) s));

tools/tiff2pdf.c:2417:5: Assignment
  2415. 					return(0);
  2416. 				}
  2417. 				buffer = (unsigned char*)
            ^
  2418. 					_TIFFmalloc(t2p->tiff_datasize);
  2419. 				if(buffer==NULL){

tools/tiff2pdf.c:2434:7: Array access: Offset: [t2p->pdf_ojpegdatalength, +oo] Size: [0, +oo] by call to `t2p_readwrite_pdf_image` 
  2432. 					tsize_t retTIFFReadRawStrip;
  2433. 					if(i != 0){
  2434. 						buffer[bufferoffset++]=0xff;
              ^
  2435. 						buffer[bufferoffset++]=(0xd0 | ((i-1)%8));
  2436. 					}
