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

tools/tiff2pdf.c:2111:1: start of procedure t2p_read_tiff_size_tile()
2109. */
2110. 
2111. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
      ^
2112. 
2113. 	uint64* tbc = NULL;

tools/tiff2pdf.c:2113:2: 
2111. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
2112. 
2113. 	uint64* tbc = NULL;
       ^
2114. 	uint16 edge=0;
2115. #ifdef JPEG_SUPPORT

tools/tiff2pdf.c:2114:2: 
2112. 
2113. 	uint64* tbc = NULL;
2114. 	uint16 edge=0;
       ^
2115. #ifdef JPEG_SUPPORT
2116. 	unsigned char* jpt;

tools/tiff2pdf.c:2120:2: 
2118.         uint64 k;
2119. 
2120. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2121. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2122. 	

tools/tiff2pdf.c:2185:1: start of procedure t2p_tile_is_right_edge()
  2183.  */
  2184. 
  2185. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2186. 
  2187. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 

tools/tiff2pdf.c:2187:7: Taking false branch
  2185. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
  2186. 
  2187. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 
              ^
  2188. 		&& (tiles.tiles_edgetilewidth != 0) ){
  2189. 		return(1);

tools/tiff2pdf.c:2191:3: 
  2189. 		return(1);
  2190. 	} else {
  2191. 		return(0);
          ^
  2192. 	}
  2193. }

tools/tiff2pdf.c:2193:1: return from a call to t2p_tile_is_right_edge
  2191. 		return(0);
  2192. 	}
  2193. }
        ^
  2194. 
  2195. /*

tools/tiff2pdf.c:2121:2: 
2119. 
2120. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2121. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2122. 	
2123. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:2200:1: start of procedure t2p_tile_is_bottom_edge()
  2198.  */
  2199. 
  2200. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2201. 
  2202. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )

tools/tiff2pdf.c:2202:7: Taking false branch
  2200. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
  2201. 
  2202. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
              ^
  2203. 		&& (tiles.tiles_edgetilelength != 0) ){
  2204. 		return(1);

tools/tiff2pdf.c:2206:3: 
  2204. 		return(1);
  2205. 	} else {
  2206. 		return(0);
          ^
  2207. 	}
  2208. }

tools/tiff2pdf.c:2208:1: return from a call to t2p_tile_is_bottom_edge
  2206. 		return(0);
  2207. 	}
  2208. }
        ^
  2209. 
  2210. /*

tools/tiff2pdf.c:2123:5: Taking true branch
2121. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2122. 	
2123. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
          ^
2124. 		if(edge
2125. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)

tools/tiff2pdf.c:2124:6: Taking false branch
2122. 	
2123. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
2124. 		if(edge
           ^
2125. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
2126. 		&& !(t2p->pdf_compression==T2P_COMPRESS_JPEG)

tools/tiff2pdf.c:2136:4: 
2134. 			return;
2135. 		} else {
2136. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
         ^
2137. 			k=tbc[tile];
2138. #ifdef OJPEG_SUPPORT

libtiff/tif_dir.c:1269:1: start of procedure TIFFGetField()
  1267.  * internal directory structure.
  1268.  */
  1269. int
        ^
  1270. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1271. {

libtiff/tif_dir.c:1275:2: 
  1273. 	va_list ap;
  1274. 
  1275. 	va_start(ap, tag);
         ^
  1276. 	status = TIFFVGetField(tif, tag, ap);
  1277. 	va_end(ap);

libtiff/tif_dir.c:1276:2: Skipping TIFFVGetField(): empty list of specs
  1274. 
  1275. 	va_start(ap, tag);
  1276. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1277. 	va_end(ap);
  1278. 	return (status);

libtiff/tif_dir.c:1277:2: 
  1275. 	va_start(ap, tag);
  1276. 	status = TIFFVGetField(tif, tag, ap);
  1277. 	va_end(ap);
         ^
  1278. 	return (status);
  1279. }

libtiff/tif_dir.c:1278:2: 
  1276. 	status = TIFFVGetField(tif, tag, ap);
  1277. 	va_end(ap);
  1278. 	return (status);
         ^
  1279. }
  1280. 

libtiff/tif_dir.c:1279:1: return from a call to TIFFGetField
  1277. 	va_end(ap);
  1278. 	return (status);
  1279. }
        ^
  1280. 
  1281. /*

tools/tiff2pdf.c:2137:4: 
2135. 		} else {
2136. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
2137. 			k=tbc[tile];
         ^
2138. #ifdef OJPEG_SUPPORT
2139. 			if(t2p->tiff_compression==COMPRESSION_OJPEG){
