libtiff/tif_dir.c:173: error: Null Dereference
  pointer `fip` last assigned on line 164 could be null and is dereferenced at line 173, column 6.

libtiff/tif_dir.c:155:1: start of procedure _TIFFVSetField()
153. }
154. 
155. static int
     ^
156. _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
157. {

libtiff/tif_dir.c:158:2: 
156. _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
157. {
158. 	static const char module[] = "_TIFFVSetField";
      ^
159. 
160. 	TIFFDirectory* td = &tif->tif_dir;

libtiff/tif_dir.c:160:2: 
158. 	static const char module[] = "_TIFFVSetField";
159. 
160. 	TIFFDirectory* td = &tif->tif_dir;
      ^
161. 	int status = 1;
162. 	uint32 v32, i, v;

libtiff/tif_dir.c:161:2: 
159. 
160. 	TIFFDirectory* td = &tif->tif_dir;
161. 	int status = 1;
      ^
162. 	uint32 v32, i, v;
163. 	char* s;

libtiff/tif_dir.c:164:2: 
162. 	uint32 v32, i, v;
163. 	char* s;
164. 	const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
      ^
165. 	uint32 standard_tag = tag;
166. 

libtiff/tif_dirinfo.c:499:1: start of procedure TIFFFindField()
  497. }
  498. 
  499. const TIFFField*
       ^
  500. TIFFFindField(TIFF* tif, uint32 tag, TIFFDataType dt)
  501. {

libtiff/tif_dirinfo.c:502:2: 
  500. TIFFFindField(TIFF* tif, uint32 tag, TIFFDataType dt)
  501. {
  502. 	TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
        ^
  503. 	TIFFField* pkey = &key;
  504. 	const TIFFField **ret;

libtiff/tif_dirinfo.c:503:2: 
  501. {
  502. 	TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
  503. 	TIFFField* pkey = &key;
        ^
  504. 	const TIFFField **ret;
  505. 	if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&

libtiff/tif_dirinfo.c:505:6: Taking true branch
  503. 	TIFFField* pkey = &key;
  504. 	const TIFFField **ret;
  505. 	if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
            ^
  506. 	    (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
  507. 		return tif->tif_foundfield;

libtiff/tif_dirinfo.c:505:29: Taking false branch
  503. 	TIFFField* pkey = &key;
  504. 	const TIFFField **ret;
  505. 	if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
                                   ^
  506. 	    (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
  507. 		return tif->tif_foundfield;

libtiff/tif_dirinfo.c:510:7: Taking true branch
  508. 
  509. 	/* If we are invoked with no field information, then just return. */
  510. 	if (!tif->tif_fields)
             ^
  511. 		return NULL;
  512. 

libtiff/tif_dirinfo.c:511:3: 
  509. 	/* If we are invoked with no field information, then just return. */
  510. 	if (!tif->tif_fields)
  511. 		return NULL;
         ^
  512. 
  513. 	/* NB: use sorted search (e.g. binary search) */

libtiff/tif_dirinfo.c:522:1: return from a call to TIFFFindField
  520. 					   sizeof(TIFFField *), tagCompare);
  521. 	return tif->tif_foundfield = (ret ? *ret : NULL);
  522. }
       ^
  523. 
  524. const TIFFField*

libtiff/tif_dir.c:165:2: 
163. 	char* s;
164. 	const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
165. 	uint32 standard_tag = tag;
      ^
166. 
167. 	/*

libtiff/tif_dir.c:173:6: 
171. 	 * tag values in custom directories (ie. EXIF) 
172. 	 */
173. 	if (fip->field_bit == FIELD_CUSTOM) {
          ^
174. 		standard_tag = 0;
175. 	}
