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

tools/tiff2pdf.c:1920:1: start of procedure t2p_read_tiff_size()
1918. */
1919. 
1920. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
      ^
1921. 
1922. 	uint64* sbc=NULL;

tools/tiff2pdf.c:1922:2: 
1920. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1921. 
1922. 	uint64* sbc=NULL;
       ^
1923. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1924. 	unsigned char* jpt=NULL;

tools/tiff2pdf.c:1924:2: 
1922. 	uint64* sbc=NULL;
1923. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1924. 	unsigned char* jpt=NULL;
       ^
1925. 	tstrip_t i=0;
1926. 	tstrip_t stripcount=0;

tools/tiff2pdf.c:1925:2: 
1923. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1924. 	unsigned char* jpt=NULL;
1925. 	tstrip_t i=0;
       ^
1926. 	tstrip_t stripcount=0;
1927. #endif

tools/tiff2pdf.c:1926:2: 
1924. 	unsigned char* jpt=NULL;
1925. 	tstrip_t i=0;
1926. 	tstrip_t stripcount=0;
       ^
1927. #endif
1928.         uint64 k = 0;

tools/tiff2pdf.c:1928:9: 
1926. 	tstrip_t stripcount=0;
1927. #endif
1928.         uint64 k = 0;
              ^
1929. 
1930. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:1930:5: Taking true branch
1928.         uint64 k = 0;
1929. 
1930. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
          ^
1931. #ifdef CCITT_SUPPORT
1932. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){

tools/tiff2pdf.c:1932:6: Taking false branch
1930. 	if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1931. #ifdef CCITT_SUPPORT
1932. 		if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
           ^
1933. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1934.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1943:6: Taking false branch
1941. #endif
1942. #ifdef ZIP_SUPPORT
1943. 		if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
           ^
1944. 			TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1945.             if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {

tools/tiff2pdf.c:1954:6: Taking true branch
1952. #endif
1953. #ifdef OJPEG_SUPPORT
1954. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
           ^
1955. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1956. 				TIFFError(TIFF2PDF_MODULE, 

tools/tiff2pdf.c:1955:8: 
1953. #ifdef OJPEG_SUPPORT
1954. 		if(t2p->tiff_compression == COMPRESSION_OJPEG){
1955. 			if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
             ^
1956. 				TIFFError(TIFF2PDF_MODULE, 
1957. 					"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",

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

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

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

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

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

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

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

tools/tiff2pdf.c:1962:4: 
1960. 				return;
1961. 			}
1962. 			stripcount=TIFFNumberOfStrips(input);
         ^
1963. 			for(i=0;i<stripcount;i++){
1964. 				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:34:1: start of procedure _TIFFMultiply32()
    32. #include <math.h>
    33. 
    34. uint32
        ^
    35. _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
    36. {

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

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

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

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

libtiff/tif_aux.c:45:1: return from a call to _TIFFMultiply32
    43. 
    44. 	return bytes;
    45. }
        ^
    46. 
    47. 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:1963:8: 
1961. 			}
1962. 			stripcount=TIFFNumberOfStrips(input);
1963. 			for(i=0;i<stripcount;i++){
             ^
1964. 				k = checkAdd64(k, sbc[i], t2p);
1965. 			}

tools/tiff2pdf.c:1963:12: Loop condition is true. Entering loop body
1961. 			}
1962. 			stripcount=TIFFNumberOfStrips(input);
1963. 			for(i=0;i<stripcount;i++){
                 ^
1964. 				k = checkAdd64(k, sbc[i], t2p);
1965. 			}

tools/tiff2pdf.c:1964:5: 
1962. 			stripcount=TIFFNumberOfStrips(input);
1963. 			for(i=0;i<stripcount;i++){
1964. 				k = checkAdd64(k, sbc[i], t2p);
          ^
1965. 			}
1966. 			if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
