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

tools/tiff2pdf.c:2089:1: start of procedure t2p_read_tiff_size_tile()
2087. */
2088. 
2089. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
      ^
2090. 
2091. 	uint64* tbc = NULL;

tools/tiff2pdf.c:2091:2: 
2089. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
2090. 
2091. 	uint64* tbc = NULL;
       ^
2092. 	uint16 edge=0;
2093. #ifdef JPEG_SUPPORT

tools/tiff2pdf.c:2092:2: 
2090. 
2091. 	uint64* tbc = NULL;
2092. 	uint16 edge=0;
       ^
2093. #ifdef JPEG_SUPPORT
2094. 	unsigned char* jpt;

tools/tiff2pdf.c:2098:2: 
2096.         uint64 k;
2097. 
2098. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2099. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2100. 	

tools/tiff2pdf.c:2163:1: start of procedure t2p_tile_is_right_edge()
  2161.  */
  2162. 
  2163. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2164. 
  2165. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 

tools/tiff2pdf.c:2165:7: Taking false branch
  2163. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
  2164. 
  2165. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 
              ^
  2166. 		&& (tiles.tiles_edgetilewidth != 0) ){
  2167. 		return(1);

tools/tiff2pdf.c:2169:3: 
  2167. 		return(1);
  2168. 	} else {
  2169. 		return(0);
          ^
  2170. 	}
  2171. }

tools/tiff2pdf.c:2171:1: return from a call to t2p_tile_is_right_edge
  2169. 		return(0);
  2170. 	}
  2171. }
        ^
  2172. 
  2173. /*

tools/tiff2pdf.c:2099:2: 
2097. 
2098. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2099. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2100. 	
2101. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:2178:1: start of procedure t2p_tile_is_bottom_edge()
  2176.  */
  2177. 
  2178. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2179. 
  2180. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )

tools/tiff2pdf.c:2180:7: Taking false branch
  2178. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
  2179. 
  2180. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
              ^
  2181. 		&& (tiles.tiles_edgetilelength != 0) ){
  2182. 		return(1);

tools/tiff2pdf.c:2184:3: 
  2182. 		return(1);
  2183. 	} else {
  2184. 		return(0);
          ^
  2185. 	}
  2186. }

tools/tiff2pdf.c:2186:1: return from a call to t2p_tile_is_bottom_edge
  2184. 		return(0);
  2185. 	}
  2186. }
        ^
  2187. 
  2188. /*

tools/tiff2pdf.c:2101:5: Taking true branch
2099. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2100. 	
2101. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
          ^
2102. 		if(edge
2103. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)

tools/tiff2pdf.c:2102:6: Taking false branch
2100. 	
2101. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
2102. 		if(edge
           ^
2103. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
2104. 		&& !(t2p->pdf_compression==T2P_COMPRESS_JPEG)

tools/tiff2pdf.c:2114:4: 
2112. 			return;
2113. 		} else {
2114. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
         ^
2115. 			k=tbc[tile];
2116. #ifdef OJPEG_SUPPORT

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:2115:4: 
2113. 		} else {
2114. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
2115. 			k=tbc[tile];
         ^
2116. #ifdef OJPEG_SUPPORT
2117. 			if(t2p->tiff_compression==COMPRESSION_OJPEG){
