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

tools/tiff2pdf.c:2016:1: start of procedure t2p_read_tiff_size_tile()
2014. */
2015. 
2016. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
      ^
2017. 
2018. 	uint64* tbc = NULL;

tools/tiff2pdf.c:2018:2: 
2016. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
2017. 
2018. 	uint64* tbc = NULL;
       ^
2019. 	uint16 edge=0;
2020. #ifdef JPEG_SUPPORT

tools/tiff2pdf.c:2019:2: 
2017. 
2018. 	uint64* tbc = NULL;
2019. 	uint16 edge=0;
       ^
2020. #ifdef JPEG_SUPPORT
2021. 	unsigned char* jpt;

tools/tiff2pdf.c:2025:2: 
2023.         uint64 k;
2024. 
2025. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2026. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2027. 	

tools/tiff2pdf.c:2090:1: start of procedure t2p_tile_is_right_edge()
  2088.  */
  2089. 
  2090. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2091. 
  2092. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 

tools/tiff2pdf.c:2092:7: Taking false branch
  2090. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
  2091. 
  2092. 	if( ((tile+1) % tiles.tiles_tilecountx == 0) 
              ^
  2093. 		&& (tiles.tiles_edgetilewidth != 0) ){
  2094. 		return(1);

tools/tiff2pdf.c:2096:3: 
  2094. 		return(1);
  2095. 	} else {
  2096. 		return(0);
          ^
  2097. 	}
  2098. }

tools/tiff2pdf.c:2098:1: return from a call to t2p_tile_is_right_edge
  2096. 		return(0);
  2097. 	}
  2098. }
        ^
  2099. 
  2100. /*

tools/tiff2pdf.c:2026:2: 
2024. 
2025. 	edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2026. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
       ^
2027. 	
2028. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){

tools/tiff2pdf.c:2105:1: start of procedure t2p_tile_is_bottom_edge()
  2103.  */
  2104. 
  2105. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
        ^
  2106. 
  2107. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )

tools/tiff2pdf.c:2107:7: Taking false branch
  2105. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
  2106. 
  2107. 	if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
              ^
  2108. 		&& (tiles.tiles_edgetilelength != 0) ){
  2109. 		return(1);

tools/tiff2pdf.c:2111:3: 
  2109. 		return(1);
  2110. 	} else {
  2111. 		return(0);
          ^
  2112. 	}
  2113. }

tools/tiff2pdf.c:2113:1: return from a call to t2p_tile_is_bottom_edge
  2111. 		return(0);
  2112. 	}
  2113. }
        ^
  2114. 
  2115. /*

tools/tiff2pdf.c:2028:5: Taking true branch
2026. 	edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2027. 	
2028. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
          ^
2029. 		if(edge
2030. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)

tools/tiff2pdf.c:2029:6: Taking false branch
2027. 	
2028. 	if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
2029. 		if(edge
           ^
2030. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
2031. 		&& !(t2p->pdf_compression==T2P_COMPRESS_JPEG)

tools/tiff2pdf.c:2041:4: 
2039. 			return;
2040. 		} else {
2041. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
         ^
2042. 			k=tbc[tile];
2043. #ifdef OJPEG_SUPPORT

libtiff/tif_dir.c:1151:1: start of procedure TIFFGetField()
  1149.  * internal directory structure.
  1150.  */
  1151. int
        ^
  1152. TIFFGetField(TIFF* tif, uint32 tag, ...)
  1153. {

libtiff/tif_dir.c:1157:2: 
  1155. 	va_list ap;
  1156. 
  1157. 	va_start(ap, tag);
         ^
  1158. 	status = TIFFVGetField(tif, tag, ap);
  1159. 	va_end(ap);

libtiff/tif_dir.c:1158:2: Skipping TIFFVGetField(): empty list of specs
  1156. 
  1157. 	va_start(ap, tag);
  1158. 	status = TIFFVGetField(tif, tag, ap);
         ^
  1159. 	va_end(ap);
  1160. 	return (status);

libtiff/tif_dir.c:1159:2: 
  1157. 	va_start(ap, tag);
  1158. 	status = TIFFVGetField(tif, tag, ap);
  1159. 	va_end(ap);
         ^
  1160. 	return (status);
  1161. }

libtiff/tif_dir.c:1160:2: 
  1158. 	status = TIFFVGetField(tif, tag, ap);
  1159. 	va_end(ap);
  1160. 	return (status);
         ^
  1161. }
  1162. 

libtiff/tif_dir.c:1161:1: return from a call to TIFFGetField
  1159. 	va_end(ap);
  1160. 	return (status);
  1161. }
        ^
  1162. 
  1163. /*

tools/tiff2pdf.c:2042:4: 
2040. 		} else {
2041. 			TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
2042. 			k=tbc[tile];
         ^
2043. #ifdef OJPEG_SUPPORT
2044. 			if(t2p->tiff_compression==COMPRESSION_OJPEG){
