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

tools/tiff2pdf.c:1944:1: start of procedure t2p_read_tiff_size()
1942. */
1943. 
1944. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
      ^
1945. 
1946. 	uint64* sbc=NULL;

tools/tiff2pdf.c:1946:2: 
1944. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1945. 
1946. 	uint64* sbc=NULL;
       ^
1947. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1948. 	unsigned char* jpt=NULL;

tools/tiff2pdf.c:1948:2: 
1946. 	uint64* sbc=NULL;
1947. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1948. 	unsigned char* jpt=NULL;
       ^
1949. 	tstrip_t i=0;
1950. 	tstrip_t stripcount=0;

tools/tiff2pdf.c:1949:2: 
1947. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1948. 	unsigned char* jpt=NULL;
1949. 	tstrip_t i=0;
       ^
1950. 	tstrip_t stripcount=0;
1951. #endif

tools/tiff2pdf.c:1950:2: 
1948. 	unsigned char* jpt=NULL;
1949. 	tstrip_t i=0;
1950. 	tstrip_t stripcount=0;
       ^
1951. #endif
1952.         uint64 k = 0;

tools/tiff2pdf.c:1952:9: 
1950. 	tstrip_t stripcount=0;
1951. #endif
1952.         uint64 k = 0;
              ^
1953. 
1954. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:1954:5: Taking true branch
1952.         uint64 k = 0;
1953. 
1954. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
          ^
1955. #ifdef CCITT_SUPPORT
1956. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){

tools/tiff2pdf.c:1956:6: Taking false branch
1954. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1955. #ifdef CCITT_SUPPORT
1956. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
           ^
1957. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1958.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1967:6: Taking false branch
1965. #endif
1966. #ifdef ZIP_SUPPORT
1967. 		if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
           ^
1968. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1969.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1978:6: Taking true branch
1976. #endif
1977. #ifdef OJPEG_SUPPORT
1978. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
           ^
1979. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1980. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:1979:8: 
1977. #ifdef OJPEG_SUPPORT
1978. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1979. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1980. 				TIFFError(TIFF2PDF_MODULE, 
1981. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

libtiff/tif_dir.c:1230:1: start of procedure TIFFGetField()
  1228.  * internal directory structure.
  1229.  */
  1230. int
        ^
  1231. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1232. {

libtiff/tif_dir.c:1236:2: 
  1234. 	va_list ap;
  1235. 
  1236. 	va_start(ap, tag);
         ^
  1237. 	status = TIFFVGetField(tif, tag, ap);
  1238. 	va_end(ap);

libtiff/tif_dir.c:1237:2: Skipping TIFFVGetField(): empty list of specs
  1235. 
  1236. 	va_start(ap, tag);
  1237. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1238. 	va_end(ap);
  1239. 	return (status);

libtiff/tif_dir.c:1238:2: 
  1236. 	va_start(ap, tag);
  1237. 	status = TIFFVGetField(tif, tag, ap);
  1238. 	va_end(ap);
         ^
  1239. 	return (status);
  1240. }

libtiff/tif_dir.c:1239:2: 
  1237. 	status = TIFFVGetField(tif, tag, ap);
  1238. 	va_end(ap);
  1239. 	return (status);
         ^
  1240. }
  1241. 

libtiff/tif_dir.c:1240:1: return from a call to TIFFGetField
  1238. 	va_end(ap);
  1239. 	return (status);
  1240. }
        ^
  1241. 
  1242. /*

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

tools/tiff2pdf.c:1986:4: 
1984. 				return;
1985. 			}
1986. 			stripcount=TIFFNumberOfStrips(input);
         ^
1987. 			for(i=0;i<stripcount;i++){
1988. 				k = checkAdd64(k, sbc[i], t2p);

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

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

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

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

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

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

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

libtiff/tif_strip.c:67:3: 
  65. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
  66. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
  67. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
        ^
  68. 		    "TIFFNumberOfStrips");
  69. 	return (nstrips);

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

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

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

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

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

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

libtiff/tif_strip.c:69:2: 
  67. 		nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
  68. 		    "TIFFNumberOfStrips");
  69. 	return (nstrips);
       ^
  70. }
  71. 

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

tools/tiff2pdf.c:1987:8: 
1985. 			}
1986. 			stripcount=TIFFNumberOfStrips(input);
1987. 			for(i=0;i<stripcount;i++){
             ^
1988. 				k = checkAdd64(k, sbc[i], t2p);
1989. 			}

tools/tiff2pdf.c:1987:12: Loop condition is true. Entering loop body
1985. 			}
1986. 			stripcount=TIFFNumberOfStrips(input);
1987. 			for(i=0;i<stripcount;i++){
                 ^
1988. 				k = checkAdd64(k, sbc[i], t2p);
1989. 			}

tools/tiff2pdf.c:1988:5: 
1986. 			stripcount=TIFFNumberOfStrips(input);
1987. 			for(i=0;i<stripcount;i++){
1988. 				k = checkAdd64(k, sbc[i], t2p);
          ^
1989. 			}
1990. 			if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
