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

tools/tiff2pdf.c:1892:1: start of procedure t2p_read_tiff_size()
1890. */
1891. 
1892. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
      ^
1893. 
1894. 	uint64* sbc=NULL;

tools/tiff2pdf.c:1894:2: 
1892. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1893. 
1894. 	uint64* sbc=NULL;
       ^
1895. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1896. 	unsigned char* jpt=NULL;

tools/tiff2pdf.c:1896:2: 
1894. 	uint64* sbc=NULL;
1895. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1896. 	unsigned char* jpt=NULL;
       ^
1897. 	tstrip_t i=0;
1898. 	tstrip_t stripcount=0;

tools/tiff2pdf.c:1897:2: 
1895. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1896. 	unsigned char* jpt=NULL;
1897. 	tstrip_t i=0;
       ^
1898. 	tstrip_t stripcount=0;
1899. #endif

tools/tiff2pdf.c:1898:2: 
1896. 	unsigned char* jpt=NULL;
1897. 	tstrip_t i=0;
1898. 	tstrip_t stripcount=0;
       ^
1899. #endif
1900.         uint64 k = 0;

tools/tiff2pdf.c:1900:9: 
1898. 	tstrip_t stripcount=0;
1899. #endif
1900.         uint64 k = 0;
              ^
1901. 
1902. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:1902:5: Taking true branch
1900.         uint64 k = 0;
1901. 
1902. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
          ^
1903. #ifdef CCITT_SUPPORT
1904. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){

tools/tiff2pdf.c:1904:6: Taking false branch
1902. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1903. #ifdef CCITT_SUPPORT
1904. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
           ^
1905. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1906.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1915:6: Taking false branch
1913. #endif
1914. #ifdef ZIP_SUPPORT
1915. 		if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
           ^
1916. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1917.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1926:6: Taking true branch
1924. #endif
1925. #ifdef OJPEG_SUPPORT
1926. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
           ^
1927. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1928. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:1927:8: 
1925. #ifdef OJPEG_SUPPORT
1926. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1927. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1928. 				TIFFError(TIFF2PDF_MODULE, 
1929. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

libtiff/tif_dir.c:1175:1: start of procedure TIFFGetField()
  1173.  * internal directory structure.
  1174.  */
  1175. int
        ^
  1176. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1177. {

libtiff/tif_dir.c:1181:2: 
  1179. 	va_list ap;
  1180. 
  1181. 	va_start(ap, tag);
         ^
  1182. 	status = TIFFVGetField(tif, tag, ap);
  1183. 	va_end(ap);

libtiff/tif_dir.c:1182:2: Skipping TIFFVGetField(): empty list of specs
  1180. 
  1181. 	va_start(ap, tag);
  1182. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1183. 	va_end(ap);
  1184. 	return (status);

libtiff/tif_dir.c:1183:2: 
  1181. 	va_start(ap, tag);
  1182. 	status = TIFFVGetField(tif, tag, ap);
  1183. 	va_end(ap);
         ^
  1184. 	return (status);
  1185. }

libtiff/tif_dir.c:1184:2: 
  1182. 	status = TIFFVGetField(tif, tag, ap);
  1183. 	va_end(ap);
  1184. 	return (status);
         ^
  1185. }
  1186. 

libtiff/tif_dir.c:1185:1: return from a call to TIFFGetField
  1183. 	va_end(ap);
  1184. 	return (status);
  1185. }
        ^
  1186. 
  1187. /*

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

tools/tiff2pdf.c:1934:4: 
1932. 				return;
1933. 			}
1934. 			stripcount=TIFFNumberOfStrips(input);
         ^
1935. 			for(i=0;i<stripcount;i++){
1936. 				k = checkAdd64(k, sbc[i], t2p);

libtiff/tif_strip.c:60:1: start of procedure TIFFNumberOfStrips()
  58.  * Compute how many strips are in an image.
  59.  */
  60. uint32
      ^
  61. TIFFNumberOfStrips(TIFF* tif)
  62. {

libtiff/tif_strip.c:63:2: 
  61. TIFFNumberOfStrips(TIFF* tif)
  62. {
  63. 	TIFFDirectory *td = &tif->tif_dir;
       ^
  64. 	uint32 nstrips;
  65. 

libtiff/tif_strip.c:72:9: Taking false branch
  70.        tif_dirread.c ~line 3612.
  71.        See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
  72.     if( td->td_nstrips )
              ^
  73.         return td->td_nstrips;
  74. 

libtiff/tif_strip.c:75:13: Condition is false
  73.         return td->td_nstrips;
  74. 
  75. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:76:7: Condition is true
  74. 
  75. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
            ^
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  78. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,

libtiff/tif_strip.c:75:13: 
  73.         return td->td_nstrips;
  74. 
  75. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:75:2: 
  73.         return td->td_nstrips;
  74. 
  75. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
       ^
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:77:6: Taking true branch
  75. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
           ^
  78. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
  79. 		    "TIFFNumberOfStrips");

libtiff/tif_strip.c:78:3: 
  76. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  77. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  78. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
        ^
  79. 		    "TIFFNumberOfStrips");
  80. 	return (nstrips);

libtiff/tif_aux.c:36:1: start of procedure _TIFFMultiply32()
    34. #include <math.h>
    35. 
    36. uint32
        ^
    37. _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
    38. {

libtiff/tif_aux.c:39:2: 
    37. _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
    38. {
    39. 	uint32 bytes = first * second;
         ^
    40. 
    41. 	if (second && bytes / second != first) {

libtiff/tif_aux.c:41:6: Taking true branch
    39. 	uint32 bytes = first * second;
    40. 
    41. 	if (second && bytes / second != first) {
             ^
    42. 		TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
    43. 		bytes = 0;

libtiff/tif_aux.c:41:16: Taking false branch
    39. 	uint32 bytes = first * second;
    40. 
    41. 	if (second && bytes / second != first) {
                       ^
    42. 		TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
    43. 		bytes = 0;

libtiff/tif_aux.c:46:2: 
    44. 	}
    45. 
    46. 	return bytes;
         ^
    47. }
    48. 

libtiff/tif_aux.c:47:1: return from a call to _TIFFMultiply32
    45. 
    46. 	return bytes;
    47. }
        ^
    48. 
    49. uint64

libtiff/tif_strip.c:80:2: 
  78. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
  79. 		    "TIFFNumberOfStrips");
  80. 	return (nstrips);
       ^
  81. }
  82. 

libtiff/tif_strip.c:81:1: return from a call to TIFFNumberOfStrips
  79. 		    "TIFFNumberOfStrips");
  80. 	return (nstrips);
  81. }
      ^
  82. 
  83. /*

tools/tiff2pdf.c:1935:8: 
1933. 			}
1934. 			stripcount=TIFFNumberOfStrips(input);
1935. 			for(i=0;i<stripcount;i++){
             ^
1936. 				k = checkAdd64(k, sbc[i], t2p);
1937. 			}

tools/tiff2pdf.c:1935:12: Loop condition is true. Entering loop body
1933. 			}
1934. 			stripcount=TIFFNumberOfStrips(input);
1935. 			for(i=0;i<stripcount;i++){
                 ^
1936. 				k = checkAdd64(k, sbc[i], t2p);
1937. 			}

tools/tiff2pdf.c:1936:5: 
1934. 			stripcount=TIFFNumberOfStrips(input);
1935. 			for(i=0;i<stripcount;i++){
1936. 				k = checkAdd64(k, sbc[i], t2p);
          ^
1937. 			}
1938. 			if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
