tools/tiff2pdf.c:2063: error: Null Dereference
  pointer `tbc` last assigned on line 2039 could be null and is dereferenced at line 2063, column 6.

tools/tiff2pdf.c:2037:1: start of procedure t2p_read_tiff_size_tile()
2035. */
2036. 
2037. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
      ^
2038. 
2039. 	uint64* tbc = NULL;

tools/tiff2pdf.c:2039:2: 
2037. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
2038. 
2039. 	uint64* tbc = NULL;
       ^
2040. 	uint16 edge=0;
2041. #ifdef JPEG_SUPPORT

tools/tiff2pdf.c:2040:2: 
2038. 
2039. 	uint64* tbc = NULL;
2040. 	uint16 edge=0;
       ^
2041. #ifdef JPEG_SUPPORT
2042. 	unsigned char* jpt;

tools/tiff2pdf.c:2046:2: 
2044.         uint64 k;
2045. 
2046. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2047. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2048. 	

tools/tiff2pdf.c:2111:1: start of procedure t2p_tile_is_right_edge()
  2109.  */
  2110. 
  2111. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2112. 
  2113. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 

tools/tiff2pdf.c:2113:7: Taking false branch
  2111. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
  2112. 
  2113. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 
              ^
  2114. 		&& (tiles.tiles_edgetilewidth != 0) ){
  2115. 		return(1);

tools/tiff2pdf.c:2117:3: 
  2115. 		return(1);
  2116. 	} else {
  2117. 		return(0);
          ^
  2118. 	}
  2119. }

tools/tiff2pdf.c:2119:1: return from a call to t2p_tile_is_right_edge
  2117. 		return(0);
  2118. 	}
  2119. }
        ^
  2120. 
  2121. /*

tools/tiff2pdf.c:2047:2: 
2045. 
2046. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2047. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2048. 	
2049. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:2126:1: start of procedure t2p_tile_is_bottom_edge()
  2124.  */
  2125. 
  2126. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2127. 
  2128. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )

tools/tiff2pdf.c:2128:7: Taking false branch
  2126. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
  2127. 
  2128. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
              ^
  2129. 		&& (tiles.tiles_edgetilelength != 0) ){
  2130. 		return(1);

tools/tiff2pdf.c:2132:3: 
  2130. 		return(1);
  2131. 	} else {
  2132. 		return(0);
          ^
  2133. 	}
  2134. }

tools/tiff2pdf.c:2134:1: return from a call to t2p_tile_is_bottom_edge
  2132. 		return(0);
  2133. 	}
  2134. }
        ^
  2135. 
  2136. /*

tools/tiff2pdf.c:2049:5: Taking true branch
2047. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2048. 	
2049. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
          ^
2050. 		if(edge
2051. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)

tools/tiff2pdf.c:2050:6: Taking false branch
2048. 	
2049. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
2050. 		if(edge
           ^
2051. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
2052. 		&& !(t2p->pdf_compression==T2P_COMPRESS_JPEG)

tools/tiff2pdf.c:2062:4: 
2060. 			return;
2061. 		} else {
2062. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
         ^
2063. 			k=tbc[tile];
2064. #ifdef OJPEG_SUPPORT

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:2063:4: 
2061. 		} else {
2062. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
2063. 			k=tbc[tile];
         ^
2064. #ifdef OJPEG_SUPPORT
2065. 			if(t2p->tiff_compression==COMPRESSION_OJPEG){
