tools/tiff2pdf.c:1865: error: Null Dereference
  pointer `sbc` last assigned on line 1829 could be null and is dereferenced at line 1865, column 10.

tools/tiff2pdf.c:1827:1: start of procedure t2p_read_tiff_size()
1825. */
1826. 
1827. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
      ^
1828. 
1829. 	uint64* sbc=NULL;

tools/tiff2pdf.c:1829:2: 
1827. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1828. 
1829. 	uint64* sbc=NULL;
       ^
1830. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1831. 	unsigned char* jpt=NULL;

tools/tiff2pdf.c:1831:2: 
1829. 	uint64* sbc=NULL;
1830. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1831. 	unsigned char* jpt=NULL;
       ^
1832. 	tstrip_t i=0;
1833. 	tstrip_t stripcount=0;

tools/tiff2pdf.c:1832:2: 
1830. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1831. 	unsigned char* jpt=NULL;
1832. 	tstrip_t i=0;
       ^
1833. 	tstrip_t stripcount=0;
1834. #endif

tools/tiff2pdf.c:1833:2: 
1831. 	unsigned char* jpt=NULL;
1832. 	tstrip_t i=0;
1833. 	tstrip_t stripcount=0;
       ^
1834. #endif
1835. #ifdef OJPEG_SUPPORT

tools/tiff2pdf.c:1836:9: 
1834. #endif
1835. #ifdef OJPEG_SUPPORT
1836.         tsize_t k = 0;
              ^
1837. #endif
1838. 

tools/tiff2pdf.c:1839:5: Taking true branch
1837. #endif
1838. 
1839. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
          ^
1840. #ifdef CCITT_SUPPORT
1841. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){

tools/tiff2pdf.c:1841:6: Taking false branch
1839. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1840. #ifdef CCITT_SUPPORT
1841. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
           ^
1842. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1843. 			t2p->tiff_datasize=(tmsize_t)sbc[0];

tools/tiff2pdf.c:1848:6: Taking false branch
1846. #endif
1847. #ifdef ZIP_SUPPORT
1848. 		if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
           ^
1849. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1850. 			t2p->tiff_datasize=(tmsize_t)sbc[0];

tools/tiff2pdf.c:1855:6: Taking true branch
1853. #endif
1854. #ifdef OJPEG_SUPPORT
1855. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
           ^
1856. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1857. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:1856:8: 
1854. #ifdef OJPEG_SUPPORT
1855. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1856. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1857. 				TIFFError(TIFF2PDF_MODULE, 
1858. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

libtiff/tif_dir.c:1048:1: start of procedure TIFFGetField()
  1046.  * internal directory structure.
  1047.  */
  1048. int
        ^
  1049. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1050. {

libtiff/tif_dir.c:1054:2: 
  1052. 	va_list ap;
  1053. 
  1054. 	va_start(ap, tag);
         ^
  1055. 	status = TIFFVGetField(tif, tag, ap);
  1056. 	va_end(ap);

libtiff/tif_dir.c:1055:2: Skipping TIFFVGetField(): empty list of specs
  1053. 
  1054. 	va_start(ap, tag);
  1055. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1056. 	va_end(ap);
  1057. 	return (status);

libtiff/tif_dir.c:1056:2: 
  1054. 	va_start(ap, tag);
  1055. 	status = TIFFVGetField(tif, tag, ap);
  1056. 	va_end(ap);
         ^
  1057. 	return (status);
  1058. }

libtiff/tif_dir.c:1057:2: 
  1055. 	status = TIFFVGetField(tif, tag, ap);
  1056. 	va_end(ap);
  1057. 	return (status);
         ^
  1058. }
  1059. 

libtiff/tif_dir.c:1058:1: return from a call to TIFFGetField
  1056. 	va_end(ap);
  1057. 	return (status);
  1058. }
        ^
  1059. 
  1060. /*

tools/tiff2pdf.c:1856:8: Taking false branch
1854. #ifdef OJPEG_SUPPORT
1855. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1856. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1857. 				TIFFError(TIFF2PDF_MODULE, 
1858. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

tools/tiff2pdf.c:1863:4: 
1861. 				return;
1862. 			}
1863. 			stripcount=TIFFNumberOfStrips(input);
         ^
1864. 			for(i=0;i<stripcount;i++){
1865. 				k += sbc[i];

libtiff/tif_strip.c:86:1: start of procedure TIFFNumberOfStrips()
  84.  * Compute how many strips are in an image.
  85.  */
  86. uint32
      ^
  87. TIFFNumberOfStrips(TIFF* tif)
  88. {

libtiff/tif_strip.c:89:2: 
  87. TIFFNumberOfStrips(TIFF* tif)
  88. {
  89. 	TIFFDirectory *td = &tif->tif_dir;
       ^
  90. 	uint32 nstrips;
  91. 

libtiff/tif_strip.c:92:13: Condition is false
  90. 	uint32 nstrips;
  91. 
  92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:93:7: Condition is true
  91. 
  92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
            ^
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  95. 		nstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,

libtiff/tif_strip.c:92:13: 
  90. 	uint32 nstrips;
  91. 
  92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:92:2: 
  90. 	uint32 nstrips;
  91. 
  92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
       ^
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:94:6: Taking true branch
  92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
           ^
  95. 		nstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,
  96. 		    "TIFFNumberOfStrips");

libtiff/tif_strip.c:95:3: 
  93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  95. 		nstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,
        ^
  96. 		    "TIFFNumberOfStrips");
  97. 	return (nstrips);

libtiff/tif_strip.c:34:1: start of procedure multiply_32()
    32. #include "tiffiop.h"
    33. 
    34. static uint32
        ^
    35. multiply_32(TIFF* tif, uint32 nmemb, uint32 elem_size, const char* where)
    36. {

libtiff/tif_strip.c:37:2: 
    35. multiply_32(TIFF* tif, uint32 nmemb, uint32 elem_size, const char* where)
    36. {
    37. 	uint32 bytes = nmemb * elem_size;
         ^
    38. 
    39. 	if (elem_size && bytes / elem_size != nmemb) {

libtiff/tif_strip.c:39:6: Taking true branch
    37. 	uint32 bytes = nmemb * elem_size;
    38. 
    39. 	if (elem_size && bytes / elem_size != nmemb) {
             ^
    40. 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
    41. 		bytes = 0;

libtiff/tif_strip.c:39:19: Taking false branch
    37. 	uint32 bytes = nmemb * elem_size;
    38. 
    39. 	if (elem_size && bytes / elem_size != nmemb) {
                          ^
    40. 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Integer overflow in %s", where);
    41. 		bytes = 0;

libtiff/tif_strip.c:44:2: 
    42. 	}
    43. 
    44. 	return (bytes);
         ^
    45. }
    46. 

libtiff/tif_strip.c:45:1: return from a call to multiply_32
    43. 
    44. 	return (bytes);
    45. }
        ^
    46. 
    47. static uint64

libtiff/tif_strip.c:97:2: 
  95. 		nstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,
  96. 		    "TIFFNumberOfStrips");
  97. 	return (nstrips);
       ^
  98. }
  99. 

libtiff/tif_strip.c:98:1: return from a call to TIFFNumberOfStrips
   96. 		    "TIFFNumberOfStrips");
   97. 	return (nstrips);
   98. }
       ^
   99. 
  100. /*

tools/tiff2pdf.c:1864:8: 
1862. 			}
1863. 			stripcount=TIFFNumberOfStrips(input);
1864. 			for(i=0;i<stripcount;i++){
             ^
1865. 				k += sbc[i];
1866. 			}

tools/tiff2pdf.c:1864:12: Loop condition is true. Entering loop body
1862. 			}
1863. 			stripcount=TIFFNumberOfStrips(input);
1864. 			for(i=0;i<stripcount;i++){
                 ^
1865. 				k += sbc[i];
1866. 			}

tools/tiff2pdf.c:1865:5: 
1863. 			stripcount=TIFFNumberOfStrips(input);
1864. 			for(i=0;i<stripcount;i++){
1865. 				k += sbc[i];
          ^
1866. 			}
1867. 			if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
