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

tools/tiff2pdf.c:1897:1: start of procedure t2p_read_tiff_size()
1895. */
1896. 
1897. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
      ^
1898. 
1899. 	uint64* sbc=NULL;

tools/tiff2pdf.c:1899:2: 
1897. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1898. 
1899. 	uint64* sbc=NULL;
       ^
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. 	unsigned char* jpt=NULL;

tools/tiff2pdf.c:1901:2: 
1899. 	uint64* sbc=NULL;
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. 	unsigned char* jpt=NULL;
       ^
1902. 	tstrip_t i=0;
1903. 	tstrip_t stripcount=0;

tools/tiff2pdf.c:1902:2: 
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. 	unsigned char* jpt=NULL;
1902. 	tstrip_t i=0;
       ^
1903. 	tstrip_t stripcount=0;
1904. #endif

tools/tiff2pdf.c:1903:2: 
1901. 	unsigned char* jpt=NULL;
1902. 	tstrip_t i=0;
1903. 	tstrip_t stripcount=0;
       ^
1904. #endif
1905.         uint64 k = 0;

tools/tiff2pdf.c:1905:9: 
1903. 	tstrip_t stripcount=0;
1904. #endif
1905.         uint64 k = 0;
              ^
1906. 
1907. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:1907:5: Taking true branch
1905.         uint64 k = 0;
1906. 
1907. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
          ^
1908. #ifdef CCITT_SUPPORT
1909. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){

tools/tiff2pdf.c:1909:6: Taking false branch
1907. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1908. #ifdef CCITT_SUPPORT
1909. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
           ^
1910. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1911.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1920:6: Taking false branch
1918. #endif
1919. #ifdef ZIP_SUPPORT
1920. 		if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
           ^
1921. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1922.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1931:6: Taking true branch
1929. #endif
1930. #ifdef OJPEG_SUPPORT
1931. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
           ^
1932. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1933. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:1932:8: 
1930. #ifdef OJPEG_SUPPORT
1931. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1932. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1933. 				TIFFError(TIFF2PDF_MODULE, 
1934. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

libtiff/tif_dir.c:1213:1: start of procedure TIFFGetField()
  1211.  * internal directory structure.
  1212.  */
  1213. int
        ^
  1214. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1215. {

libtiff/tif_dir.c:1219:2: 
  1217. 	va_list ap;
  1218. 
  1219. 	va_start(ap, tag);
         ^
  1220. 	status = TIFFVGetField(tif, tag, ap);
  1221. 	va_end(ap);

libtiff/tif_dir.c:1220:2: Skipping TIFFVGetField(): empty list of specs
  1218. 
  1219. 	va_start(ap, tag);
  1220. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1221. 	va_end(ap);
  1222. 	return (status);

libtiff/tif_dir.c:1221:2: 
  1219. 	va_start(ap, tag);
  1220. 	status = TIFFVGetField(tif, tag, ap);
  1221. 	va_end(ap);
         ^
  1222. 	return (status);
  1223. }

libtiff/tif_dir.c:1222:2: 
  1220. 	status = TIFFVGetField(tif, tag, ap);
  1221. 	va_end(ap);
  1222. 	return (status);
         ^
  1223. }
  1224. 

libtiff/tif_dir.c:1223:1: return from a call to TIFFGetField
  1221. 	va_end(ap);
  1222. 	return (status);
  1223. }
        ^
  1224. 
  1225. /*

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

tools/tiff2pdf.c:1939:4: 
1937. 				return;
1938. 			}
1939. 			stripcount=TIFFNumberOfStrips(input);
         ^
1940. 			for(i=0;i<stripcount;i++){
1941. 				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:66:13: Condition is false
  64. 	uint32 nstrips;
  65. 
  66. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:67:7: Condition is true
  65. 
  66. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
            ^
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  69. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,

libtiff/tif_strip.c:66:13: 
  64. 	uint32 nstrips;
  65. 
  66. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                  ^
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:66:2: 
  64. 	uint32 nstrips;
  65. 
  66. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
       ^
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

libtiff/tif_strip.c:68:6: Taking true branch
  66. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
           ^
  69. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
  70. 		    "TIFFNumberOfStrips");

libtiff/tif_strip.c:69:3: 
  67. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  68. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  69. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
        ^
  70. 		    "TIFFNumberOfStrips");
  71. 	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:71:2: 
  69. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
  70. 		    "TIFFNumberOfStrips");
  71. 	return (nstrips);
       ^
  72. }
  73. 

libtiff/tif_strip.c:72:1: return from a call to TIFFNumberOfStrips
  70. 		    "TIFFNumberOfStrips");
  71. 	return (nstrips);
  72. }
      ^
  73. 
  74. /*

tools/tiff2pdf.c:1940:8: 
1938. 			}
1939. 			stripcount=TIFFNumberOfStrips(input);
1940. 			for(i=0;i<stripcount;i++){
             ^
1941. 				k = checkAdd64(k, sbc[i], t2p);
1942. 			}

tools/tiff2pdf.c:1940:12: Loop condition is true. Entering loop body
1938. 			}
1939. 			stripcount=TIFFNumberOfStrips(input);
1940. 			for(i=0;i<stripcount;i++){
                 ^
1941. 				k = checkAdd64(k, sbc[i], t2p);
1942. 			}

tools/tiff2pdf.c:1941:5: 
1939. 			stripcount=TIFFNumberOfStrips(input);
1940. 			for(i=0;i<stripcount;i++){
1941. 				k = checkAdd64(k, sbc[i], t2p);
          ^
1942. 			}
1943. 			if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
